Documentation ¶
Index ¶
- type Code
- type Email
- type Error
- type HTTPError
- type ID
- func DecodeIDFromString(value string) (ID, error)
- func DeriveMutableID(body Mutable, base ID, derivableType idtype.Type) ID
- func NewFakeMutableID(body Mutable, source string) (ID, error)
- func NewID(t idtype.Type) (ID, error)
- func NewImmutableID(obj Immutable, sig interface{}) (ID, error)
- func NewMutableID(body Mutable) (ID, error)
- type Identifiable
- type Immutable
- type Label
- type Mutable
- type Name
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶ added in v0.7.2
type Code string
Code represents a manifold verification code ( E-Mail Verification )
type Error ¶
Error represents an Error returned by this Middleware to a requestor
func (*Error) Code ¶
Code returns the HTTP Status Code associated with this Error, completes the go-openapi error interface.
func (*Error) StatusCode ¶
StatusCode returns the HTTP Status Code associated with this error, completes the HTTPError interface.
func (*Error) WriteResponse ¶
func (e *Error) WriteResponse(w http.ResponseWriter, pr runtime.Producer)
WriteResponse completes the interface for a middleware.Responder from go-openapi/runtime
A panic will occur if the given producer errors.
type HTTPError ¶
type HTTPError interface { error StatusCode() int WriteResponse(http.ResponseWriter, runtime.Producer) }
HTTPError interface represents an error that is returned to a user as an HTTP response
type ID ¶
type ID [byteLength]byte
ID is an encoded unique identifier for an object.
The first byte holds the schema version of the id itself. The second byte holds the type of the object. The remaining 16 bytes hold a digest of the contents of the object for immutable objects, or a random value for mutable objects.
func DecodeIDFromString ¶ added in v0.0.2
DecodeIDFromString returns an ID that is stored in the given string.
func DeriveMutableID ¶ added in v0.0.2
DeriveMutableID returns a ID for a mutable object based on another ID.
func NewFakeMutableID ¶ added in v0.0.2
NewFakeMutableID returns an ID for a fake mutable object, not relying on the Body contents of the supplied mutable to generate the ID
func NewImmutableID ¶ added in v0.0.2
NewImmutableID returns a new signed ID for an immutable object.
sig should be a registry.Signature type
func NewMutableID ¶ added in v0.0.2
NewMutableID returns a new ID for a mutable object.
func (ID) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for IDs.
IDs are encoded in unpadded base32.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for IDs.
type Identifiable ¶
Identifiable is the interface implemented by objects that can be given IDs.
type Immutable ¶
type Immutable interface { Identifiable GetBody() interface{} Immutable() // We don't ever need to call this, its just for type checking. }
Immutable structs are Identifiables that do not change, and should be signed.
type Mutable ¶
type Mutable interface { Identifiable Mutable() // also just for type checking. }
Mutable structs are Identifiables that can be changed.