Documentation ¶
Index ¶
- Variables
- type API
- func (a *API) Authenticate(ctx context.Context, id, secret string) (string, *jwt.NumericDate, error)
- func (a *API) Authorize(e Entity, scope []string) bool
- func (a *API) CreateEntity(ctx context.Context, secret, note string, scope []string) (string, error)
- func (a *API) CreateToken(e Entity) *jwt.Token
- func (a *API) GetEntity(ctx context.Context, id string) (Entity, error)
- func (a *API) GetEntityByTokenString(ctx context.Context, token string) (Entity, error)
- func (a *API) GetTokenSignedString(t *jwt.Token) (string, error)
- func (a *API) UpdateEntity(ctx context.Context, id, secret, note string, scope []string) error
- type Entity
- type ErrInvalidArg
- type TokenClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) Authenticate ¶
func (*API) CreateEntity ¶
func (*API) CreateToken ¶
func (*API) GetEntityByTokenString ¶
func (*API) GetTokenSignedString ¶
type ErrInvalidArg ¶
type ErrInvalidArg struct {
Msg string
}
func (ErrInvalidArg) Error ¶
func (e ErrInvalidArg) Error() string
func (ErrInvalidArg) Is ¶
func (e ErrInvalidArg) Is(err error) bool
type TokenClaims ¶
type TokenClaims struct {
jwt.RegisteredClaims
}
Click to show internal directories.
Click to hide internal directories.