Documentation
¶
Index ¶
- Variables
- type DynamoDBTokenStorer
- func (s *DynamoDBTokenStorer) Create(ctx context.Context, name string) (*Token, error)
- func (s *DynamoDBTokenStorer) Delete(ctx context.Context, id string) error
- func (s *DynamoDBTokenStorer) Get(ctx context.Context, id string) (*Token, error)
- func (s *DynamoDBTokenStorer) List(ctx context.Context) ([]Token, error)
- type InMemoryTokenStorer
- func (s *InMemoryTokenStorer) Create(ctx context.Context, name string) (*Token, error)
- func (s *InMemoryTokenStorer) Delete(ctx context.Context, id string) error
- func (s *InMemoryTokenStorer) Get(ctx context.Context, id string) (*Token, error)
- func (s *InMemoryTokenStorer) List(ctx context.Context) ([]Token, error)
- type Token
- type TokenStorer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTokenNotFound = errors.New("token not found")
Functions ¶
This section is empty.
Types ¶
type DynamoDBTokenStorer ¶
type DynamoDBTokenStorer struct {
// contains filtered or unexported fields
}
DynamoDBTokenStorer is a token storage backend which uses DynamoDB
func NewDynamoDBTokenStorer ¶
func NewDynamoDBTokenStorer(ctx context.Context, tableName string, log *zap.SugaredLogger, tracer trace.Tracer) (*DynamoDBTokenStorer, error)
NewDynamoDBTokenStorer initialises the AWS DynamoDB client and returns a new DynamoDBTokenStorer
func (*DynamoDBTokenStorer) Delete ¶
func (s *DynamoDBTokenStorer) Delete(ctx context.Context, id string) error
Delete a token from the database
type InMemoryTokenStorer ¶
type InMemoryTokenStorer struct {
// contains filtered or unexported fields
}
InMemoryTokenStorer is a token storage backend which stores tokens in memory. Should only be used for development and testing.
func NewInMemoryTokenStorer ¶
func NewInMemoryTokenStorer(ctx context.Context, log *zap.SugaredLogger, tracer trace.Tracer) *InMemoryTokenStorer
NewInMemoryTokenStorer initialises the in memory token storage
func (*InMemoryTokenStorer) Delete ¶
func (s *InMemoryTokenStorer) Delete(ctx context.Context, id string) error
Delete a token
Click to show internal directories.
Click to hide internal directories.