Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultTTL default signature ttl DefaultTTL = time.Minute // IdentifierLen identifier's fix length IdentifierLen = 6 )
View Source
const (
// GRPC the grpc method
GRPC = "GRPC"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Identifier ¶
type Identifier = string
Identifier distinguish what system is displayed, fix length is IdentifierLen
type Method ¶
Method define supproted http method
var ( // MethodUnknow unknow MethodUnknow Method = &method{value: "UNKNOW"} // MethodGet http get MethodGet Method = &method{value: http.MethodGet} // MethodHead http head MethodHead Method = &method{value: http.MethodHead} // MethodPost http post MethodPost Method = &method{value: http.MethodPost} // MethodPut http put MethodPut Method = &method{value: http.MethodPut} // MethodPatch http patch MethodPatch Method = &method{value: http.MethodPatch} // MethodDelete http delete MethodDelete Method = &method{value: http.MethodDelete} // MethodConnect http connect MethodConnect Method = &method{value: http.MethodConnect} // MethodOptions http options MethodOptions Method = &method{value: http.MethodOptions} // MethodTrace http trace MethodTrace Method = &method{value: http.MethodTrace} // MethodGRPC grpc MethodGRPC Method = &method{value: GRPC} )
type Option ¶
type Option func(*option)
Option optional config
func WithSecrets ¶
func WithSecrets(secrets map[Identifier]Secret) Option
WithSecrets setup mutli identifier-secret
type Signature ¶
type Signature interface { ResetSecrets(secrets map[Identifier]Secret) error Generate(identifier Identifier, method Method, uri string, body []byte) (authorization, date string, err error) Verify(authorization, date string, method Method, uri string, body []byte) (identifier Identifier, ok bool, err error) }
Signature defines methods of signature
func NewSignature ¶
NewSignature create a new signature instance
Click to show internal directories.
Click to hide internal directories.