Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidKey = errors.New("invalid key") ErrMalformedMessage = errors.New("malformed message") ErrInvalidSignature = errors.New("message has an invalid signature") ErrMalformedSignature = errors.New("message has a nalformed signature") ErrMissingSignature = errors.New("message is missing signature segment") ErrMessageExpired = errors.New("message is expired") )
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { Data interface{} `json:"data"` ExpiresAt string `json:"exp,omitempty"` Hasher func() hash.Hash `json:"-"` Purpose string `json:"pur"` // contains filtered or unexported fields }
func (*Message) DataString ¶
func (*Message) ToRails ¶
func (m *Message) ToRails() *RailsMessage
type RailsMessage ¶
type RailsMessage struct {
Message *Message `json:"_rails"`
}
func VerifiedRails ¶
func VerifiedRails(signedMessage string, key []byte) (*RailsMessage, error)
Click to show internal directories.
Click to hide internal directories.