Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext(ctx context.Context, c Credential) context.Context
NewContext returns a new context carrying credential 'c'.
Types ¶
type AuthCredential ¶
type AuthCredential interface {
Id() string
}
Auth credential is an interface to be implemented by credentials, i.e. user & permission
type Credential ¶
type Credential int
Credential is a value stored in the context that identifies whether the request uses a user credential or permission credential.
const ( User Credential = iota Permission )
Credentials
func FromContext ¶
func FromContext(ctx context.Context) (Credential, error)
FromContext retrieves credential type stored in the context against credential.CtxKey.
Click to show internal directories.
Click to hide internal directories.