Documentation
¶
Index ¶
- Variables
- type Caster
- type CompoundModel
- type Error
- func (e *Error) BodyLength() int
- func (e *Error) Err() error
- func (e *Error) Error() string
- func (e *Error) ErrorCode(code string) *Error
- func (e *Error) Format(msg string, args ...interface{}) *Error
- func (e *Error) FormatFunc(msg string) func(args ...interface{}) *Error
- func (e *Error) Header() http.Header
- func (e *Error) RPCCode() int64
- func (e *Error) Reason(args ...interface{}) *Error
- func (e *Error) Scan(src interface{}) error
- func (e *Error) Status(status int) *Error
- func (e *Error) StatusCode() int
- func (e *Error) String() string
- func (*Error) Validate(formats strfmt.Registry) error
- func (e Error) Value() (driver.Value, error)
- func (e *Error) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
- type InfluxPoint
- func (p *InfluxPoint) ColIndex(key string) int
- func (p *InfluxPoint) Columns() []string
- func (p *InfluxPoint) Get(key string) Value
- func (p *InfluxPoint) Map() map[string]interface{}
- func (p *InfluxPoint) Series() *InfluxSeries
- func (p *InfluxPoint) Tag(key string) string
- func (p *InfluxPoint) Tags() map[string]string
- func (p *InfluxPoint) UnmarshalStruct(prefix string, out interface{}, tags ...string) bool
- func (p *InfluxPoint) Value(key string) Value
- type InfluxSeries
- func (s *InfluxSeries) AddColumn(key string) int
- func (s *InfluxSeries) ColIndex(key string) int
- func (s *InfluxSeries) Columns() []string
- func (s *InfluxSeries) Length() int
- func (s *InfluxSeries) NewPoint(val interface{}, ts time.Time, points ...*InfluxPoint) *InfluxPoint
- func (s *InfluxSeries) Scan(scan func(point *InfluxPoint) error) error
- func (s *InfluxSeries) Tag(key string) string
- func (s *InfluxSeries) Tags() map[string]string
- type Link
- type MapFilter
- type Mapper
- type Model
- type ModelBase
- type Params
- type Profile
- func (m *Profile) MarshalBinary() ([]byte, error)
- func (m Profile) MarshalJSON() ([]byte, error)
- func (m *Profile) Scan(value interface{}) error
- func (m *Profile) UnmarshalBinary(b []byte) error
- func (m *Profile) UnmarshalJSON(raw []byte) error
- func (m *Profile) Validate(formats strfmt.Registry) error
- func (m *Profile) Value() (driver.Value, error)
- type Response
- func (r *Response) Body() []byte
- func (r *Response) Copy() *Response
- func (r *Response) Header() http.Header
- func (r *Response) Length() int
- func (r *Response) SetAcceleration(acc bool) *Response
- func (r *Response) SetHeader(name, value string) *Response
- func (r *Response) SetHeaderMap(vals map[string]string) *Response
- func (r *Response) SetHeaders(h http.Header) *Response
- func (r *Response) SetOptions(options ...*ResponseOptions) *Response
- func (r *Response) SetPayload(payload interface{}) *Response
- func (r *Response) SetStatus(s int) *Response
- func (r *Response) StatusCode() int
- func (r *Response) Write(body []byte) (int, error)
- func (r *Response) WriteHeader(statusCode int)
- func (r *Response) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
- type ResponseOptions
- type Slicer
- type StringArray
- type StringMap
- func (p StringMap) Bool(key string, def ...bool) bool
- func (p StringMap) Cast(key interface{}) Caster
- func (p StringMap) Copy() Mapper
- func (p StringMap) Delete(key interface{})
- func (p StringMap) DeleteAll(keys ...interface{})
- func (p StringMap) Float64(key string, def ...float64) float64
- func (p StringMap) ForEach(itr func(key, value interface{}))
- func (p StringMap) Get(key interface{}) interface{}
- func (p StringMap) GetValue(key string) (Value, bool)
- func (p StringMap) Int64(key string, def ...int64) int64
- func (p StringMap) IsSet(key interface{}) bool
- func (p StringMap) Keys() interface{}
- func (p *StringMap) Scan(src interface{}) error
- func (p StringMap) Set(key, value interface{})
- func (p StringMap) String(key string, def ...string) string
- func (p StringMap) StringMap() StringMap
- func (p StringMap) StringPtr(key string, def ...string) *string
- func (p StringMap) StringSlice(key string) []string
- func (p StringMap) Sub(key interface{}) Mapper
- func (*StringMap) Validate(formats strfmt.Registry) error
- func (p StringMap) Value() (driver.Value, error)
- func (p StringMap) Values() interface{}
- func (p StringMap) With(keys ...interface{}) Mapper
- func (p StringMap) Without(keys ...interface{}) Mapper
- type Ticker
- type UUIDArray
- type Value
- func (v Value) Bool() bool
- func (v Value) Float64() float64
- func (v Value) Int64() int64
- func (v Value) Interface() interface{}
- func (v Value) IsJSONNumber() bool
- func (v Value) IsNil() bool
- func (v Value) Slice() []interface{}
- func (v Value) String() string
- func (v Value) StringMap() StringMap
- func (v Value) StringPtr() *string
- func (v Value) StringSlice() []string
- func (v Value) Time() time.Time
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotAuthorized defines a not authorized error ErrNotAuthorized = NewError().Status(http.StatusUnauthorized).Format("not authorized") // ErrInvalidParameter defines an invalid parameter error ErrInvalidParameter = NewError().Status(http.StatusBadRequest).Format("invalid parameter") // ErrNotImplemented defines a not implemented error ErrNotImplemented = NewError().Status(http.StatusNotImplemented).FormatFunc("method '%s' not implemented") // ErrResourceConflict is returned when an object conflicts with one that already exists ErrResourceConflict = NewError().Status(http.StatusConflict).FormatFunc("'%s' conflicts with one that already exists") // ErrNotFound is is returned when an object was not found ErrNotFound = NewError().Status(http.StatusNotFound).FormatFunc("'%s' not found") // ErrServerError is reserved for server errors ErrServerError = NewError().Status(http.StatusInternalServerError).FormatFunc("server error: %s") )
var ( // NoContentResponse is a no content HTTP success response NoContentResponse = NewResponse().SetStatus(http.StatusNoContent) // SeeOtherResponse returns a redirect response SeeOtherResponse = func(loc string) *Response { return NewResponse().SetStatus(http.StatusSeeOther).SetHeader("Location", loc) } )
var ( // PathSeparator is the character used to separate the elements // of the keypath. // // For example, `location.address.city` PathSeparator = "." // SignatureSeparator is the character that is used to // separate the Base64 string from the security signature. SignatureSeparator = "_" )
var ( // DefaultProfile is a default profile object DefaultProfile = &Profile{ StandardClaims: openid.StandardClaims{ Locale: ptr.String("en-US"), }, } )
var ModelGenerateUUID = false
ModelGenerateUUID is a flag to tell sparks to generate a new uuid for the models
Functions ¶
This section is empty.
Types ¶
type Caster ¶ added in v1.1.3
type Caster interface {
String() string
StringPtr() *string
StringSlice() []string
Bool() bool
Int64() int64
Float64() float64
Slice() []interface{}
StringMap() StringMap
Time() time.Time
}
Caster defines a simple casting interface
type CompoundModel ¶ added in v1.3.2
type CompoundModel struct {
ModelBase
// Table unitque identifier
// Read Only: true
ID int64 `json:"id,omitempty"`
// Universally unique identifier
// Read Only: true
UUID *strfmt.UUID `json:"uuid,omitempty"`
}
CompoundModel uses an integer for the primary key, but also has an optional UUID
func (*CompoundModel) BeforeCreate ¶ added in v1.3.2
func (m *CompoundModel) BeforeCreate() (err error)
BeforeCreate hooks the gorm on create
func (*CompoundModel) MarshalBinary ¶ added in v1.3.2
func (m *CompoundModel) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*CompoundModel) UnmarshalBinary ¶ added in v1.3.2
func (m *CompoundModel) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
type Error ¶
type Error struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Detail map[string]interface{} `json:"detail,omitempty"`
// contains filtered or unexported fields
}
Error is the common error struct compatible with swagger response types
func (*Error) BodyLength ¶
BodyLength returns the http body length in bytes
func (*Error) FormatFunc ¶
FormatFunc func formats a error message functor
func (*Error) RPCCode ¶ added in v1.4.1
RPCCode returns an approximate json-rpc code corresponding to the http status
func (*Error) WriteResponse ¶
func (e *Error) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
WriteResponse implements the middleware.Responder interface
type InfluxPoint ¶ added in v1.3.2
type InfluxPoint struct {
Values []interface{}
Index int
Time time.Time
// contains filtered or unexported fields
}
InfluxPoint is a point in series data
func (*InfluxPoint) ColIndex ¶ added in v1.3.2
func (p *InfluxPoint) ColIndex(key string) int
ColIndex get the index of a column
func (*InfluxPoint) Columns ¶ added in v1.3.2
func (p *InfluxPoint) Columns() []string
Columns return the point columns
func (*InfluxPoint) Get ¶ added in v1.3.2
func (p *InfluxPoint) Get(key string) Value
Get returns a value for the key from values or tags
func (*InfluxPoint) Map ¶ added in v1.3.2
func (p *InfluxPoint) Map() map[string]interface{}
Map returns a map of the point
func (*InfluxPoint) Series ¶ added in v1.3.2
func (p *InfluxPoint) Series() *InfluxSeries
Series returns the series for the point
func (*InfluxPoint) Tag ¶ added in v1.3.2
func (p *InfluxPoint) Tag(key string) string
Tag returns a tag value
func (*InfluxPoint) Tags ¶ added in v1.3.2
func (p *InfluxPoint) Tags() map[string]string
Tags returns the list of tags
func (*InfluxPoint) UnmarshalStruct ¶ added in v1.3.2
func (p *InfluxPoint) UnmarshalStruct(prefix string, out interface{}, tags ...string) bool
UnmarshalStruct unmarshals series data into the structure
func (*InfluxPoint) Value ¶ added in v1.3.2
func (p *InfluxPoint) Value(key string) Value
Value returns a value for the key from values or tags
type InfluxSeries ¶ added in v1.3.2
type InfluxSeries struct {
// contains filtered or unexported fields
}
InfluxSeries is a class for scanning influx data
func NewInfluxSeries ¶ added in v1.3.2
func NewInfluxSeries(row models.Row, colPrefix ...string) *InfluxSeries
NewInfluxSeries creates a new influx series mapper
func (*InfluxSeries) AddColumn ¶ added in v1.3.2
func (s *InfluxSeries) AddColumn(key string) int
AddColumn adds a new column to the series at the end
func (*InfluxSeries) ColIndex ¶ added in v1.3.2
func (s *InfluxSeries) ColIndex(key string) int
ColIndex get the index of a column
func (*InfluxSeries) Columns ¶ added in v1.3.2
func (s *InfluxSeries) Columns() []string
Columns return the point columns
func (*InfluxSeries) Length ¶ added in v1.3.2
func (s *InfluxSeries) Length() int
Length returns the length of the values
func (*InfluxSeries) NewPoint ¶ added in v1.3.2
func (s *InfluxSeries) NewPoint(val interface{}, ts time.Time, points ...*InfluxPoint) *InfluxPoint
NewPoint creates a new point from the map
func (*InfluxSeries) Scan ¶ added in v1.3.2
func (s *InfluxSeries) Scan(scan func(point *InfluxPoint) error) error
Scan a series
func (*InfluxSeries) Tag ¶ added in v1.3.2
func (s *InfluxSeries) Tag(key string) string
Tag returns a tag value
func (*InfluxSeries) Tags ¶ added in v1.3.2
func (s *InfluxSeries) Tags() map[string]string
Tags returns the list of tags
type Link ¶
type Link struct {
// expires at
ExpiresAt int64 `json:"expires_at,omitempty"`
// the target url/uri
// Format: uri
Href strfmt.URI `json:"href,omitempty"`
// optional link name
Name *string `json:"name,omitempty"`
}
Link an href link object swagger:model Link
func (*Link) MarshalBinary ¶
MarshalBinary interface implementation
func (*Link) UnmarshalBinary ¶
UnmarshalBinary interface implementation
type MapFilter ¶ added in v1.1.0
MapFilter returns true and the key and value, or false if the value should be skipped
type Mapper ¶ added in v1.1.0
type Mapper interface {
IsSet(key interface{}) bool
Set(key, value interface{})
Get(key interface{}) interface{}
Cast(key interface{}) Caster
Sub(key interface{}) Mapper
Delete(key interface{})
DeleteAll(keys ...interface{})
Copy() Mapper
With(keys ...interface{}) Mapper
Without(keys ...interface{}) Mapper
Values() interface{}
Keys() interface{}
StringMap() StringMap
ForEach(func(key, value interface{}))
}
Mapper provides a map wrapper interface for working easily with unknown map types
type Model ¶
type Model struct {
ModelBase
// Universally unique identifier
// Read Only: true
ID strfmt.UUID `json:"id,omitempty"`
}
Model is the default database model that uses a UUID as a primary key
func (*Model) BeforeCreate ¶ added in v1.3.0
BeforeCreate hooks the gorm on create
func (*Model) MarshalBinary ¶
MarshalBinary interface implementation
func (*Model) UnmarshalBinary ¶
UnmarshalBinary interface implementation
type ModelBase ¶ added in v1.3.2
type ModelBase struct {
// Date and time of object creation
// Read Only: true
CreatedAt strfmt.DateTime `json:"created_at,omitempty" sql:"column:_created_at"`
// Last date of object modification
// Read Only: true
UpdatedAt strfmt.DateTime `json:"updated_at,omitempty" sql:"column:_updated_at"`
// meta
Meta StringMap `json:"meta,omitempty"`
// tags
Tags StringArray `json:"tags,omitempty"`
// contains filtered or unexported fields
}
ModelBase is the base model attributes
func (*ModelBase) SetContext ¶ added in v1.3.2
SetContext sets a context key on the object
type Params ¶
type Params = StringMap
Params is a simple type alias for a Map
func ParseStringParams ¶
ParseStringParams parses a parameter string and returns a params object Example string: foo=bar aparam="value"
type Profile ¶ added in v1.3.1
type Profile struct {
openid.StandardClaims
// extended attributes
ExtendedAttributes map[string]string `json:"extendedAttributes,omitempty"`
}
Profile A record profile, optional user/client data. swagger:model Profile
func (*Profile) MarshalBinary ¶ added in v1.3.1
MarshalBinary interface implementation
func (Profile) MarshalJSON ¶ added in v1.3.1
MarshalJSON marshals this object to a JSON structure
func (*Profile) UnmarshalBinary ¶ added in v1.3.1
UnmarshalBinary interface implementation
func (*Profile) UnmarshalJSON ¶ added in v1.3.1
UnmarshalJSON unmarshals this object from a JSON structure
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response defines a simple middleware.Responder struct
func NewResponse ¶
func NewResponse(options ...*ResponseOptions) *Response
NewResponse returns a new response object
func (*Response) SetAcceleration ¶
SetAcceleration enables json acceleration
func (*Response) SetHeaderMap ¶
SetHeaderMap sets additional response headers
func (*Response) SetHeaders ¶
SetHeaders sets all of the headers
func (*Response) SetOptions ¶
func (r *Response) SetOptions(options ...*ResponseOptions) *Response
SetOptions sets the options for a response
func (*Response) SetPayload ¶
SetPayload sets the payload
func (*Response) StatusCode ¶
StatusCode returns the response http status code
func (*Response) WriteHeader ¶
WriteHeader implements the http.ResponseWriter.WriteHeader() method
func (*Response) WriteResponse ¶
func (r *Response) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
WriteResponse implements the middleware.Responder.WriteResponse() method
type ResponseOptions ¶
type ResponseOptions struct {
Request *http.Request
Encoding string
ContentType string
Binary bool
Acceleration bool
}
ResponseOptions defines responder options
type Slicer ¶ added in v1.1.0
type Slicer interface {
Append(vals ...interface{}) Slicer
Insert(index int, val interface{}) Slicer
IndexOf(val interface{}) int
Len() int
Get(index int) interface{}
Remove(index int) Slicer
Filter(func(index int, val interface{}) bool) Slicer
ForEach(func(index int, val interface{})) Slicer
Map(out interface{}, filters ...MapFilter) Slicer
ToStringMap() StringMap
Contains(values ...interface{}) bool
ContainsAny(values ...interface{}) bool
}
Slicer is a generic slice manipulation interface helper
type StringArray ¶
type StringArray pq.StringArray
StringArray is a proper string array type
func (*StringArray) Scan ¶
func (a *StringArray) Scan(src interface{}) error
Scan implements the sql.Scanner interface
type StringMap ¶
type StringMap map[string]interface{}
StringMap is a wrapper on a map[string]interface{} that implements the Mapper interface
func (StringMap) Delete ¶ added in v1.1.0
func (p StringMap) Delete(key interface{})
Delete removes a key
func (StringMap) DeleteAll ¶ added in v1.3.4
func (p StringMap) DeleteAll(keys ...interface{})
DeleteAll removes several keys
func (StringMap) ForEach ¶ added in v1.4.7
func (p StringMap) ForEach(itr func(key, value interface{}))
ForEach iterates over the map
func (StringMap) Get ¶ added in v1.1.0
func (p StringMap) Get(key interface{}) interface{}
Get returns the value and if the key is set
func (StringMap) Keys ¶ added in v1.3.2
func (p StringMap) Keys() interface{}
Keys returns the keys from the map
func (StringMap) Set ¶ added in v1.1.0
func (p StringMap) Set(key, value interface{})
Set sets a value in the map
func (StringMap) String ¶ added in v1.1.0
String returns a string value for the param, or the optional default
func (StringMap) StringSlice ¶ added in v1.1.0
StringSlice returns a string value for the param, or the optional default
func (StringMap) Values ¶ added in v1.3.2
func (p StringMap) Values() interface{}
Values returns the keys from the map
type Ticker ¶ added in v1.1.1
type Ticker struct {
// contains filtered or unexported fields
}
Ticker is a ticker wrapper with some extra functionality
type UUIDArray ¶
UUIDArray is a proper string array type
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value defines a value wrapper
func (Value) Interface ¶ added in v1.1.0
func (v Value) Interface() interface{}
Interface returns the underlying interface for the value
func (Value) IsJSONNumber ¶ added in v1.3.2
IsJSONNumber return true if the original value was a json.Number
func (Value) Slice ¶ added in v1.3.0
func (v Value) Slice() []interface{}
Slice returns the value cast as []interface{}
func (Value) StringSlice ¶
StringSlice casts the value to a string slice
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package binary provides helpers for encoding binary data from a spec file very loosely based on kaitai; see https://doc.kaitai.io.
|
Package binary provides helpers for encoding binary data from a spec file very loosely based on kaitai; see https://doc.kaitai.io. |
|
encoding/ewkb
Package ewkb implements Well Known Binary encoding and decoding.
|
Package ewkb implements Well Known Binary encoding and decoding. |
|
Package ptr provides some helpers for converting types to pointers
|
Package ptr provides some helpers for converting types to pointers |