Documentation ¶
Overview ¶
Package key Code generated by go-bindata. (@generated) DO NOT EDIT. sources: migrations/sql/shared/.gitattributes migrations/sql/shared/.gitkeep migrations/sql/shared/sole_key.sql
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func CreateKey(ctx context.Context, r Manager, g KeyGenerator, setId string) (*jose.JSONWebKeySet, error)
- func FindKeyByPrefix(set *jose.JSONWebKeySet, prefix string) (key *jose.JSONWebKey, err error)
- func FindKeysByPrefix(set *jose.JSONWebKeySet, prefix string) (*jose.JSONWebKeySet, error)
- func FirstKey(keys []jose.JSONWebKey) *jose.JSONWebKey
- func Ider(typ, id string) string
- func MustAsset(name string) []byte
- func PEMBlockForKey(key interface{}) (*pem.Block, error)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type KeyGenerator
- type Manager
- type MemoryManager
- func (m *MemoryManager) AddKey(ctx context.Context, setId string, key *jose.JSONWebKey) error
- func (m *MemoryManager) AddKeySet(ctx context.Context, setId string, keys *jose.JSONWebKeySet) error
- func (m *MemoryManager) DeleteKey(ctx context.Context, setId, keyId string) error
- func (m *MemoryManager) DeleteKeySet(ctx context.Context, setId string) error
- func (m *MemoryManager) GetKey(ctx context.Context, setId, keyId string) (*jose.JSONWebKeySet, error)
- func (m *MemoryManager) GetKeySet(ctx context.Context, setId string) (*jose.JSONWebKeySet, error)
- type Provider
- type RS256Generator
- type SQLManager
- func (m *SQLManager) AddKey(ctx context.Context, setId string, key *jose.JSONWebKey) error
- func (m *SQLManager) AddKeySet(ctx context.Context, setId string, keys *jose.JSONWebKeySet) error
- func (m *SQLManager) DeleteKey(ctx context.Context, setId, keyId string) error
- func (m *SQLManager) DeleteKeySet(ctx context.Context, setId string) error
- func (m *SQLManager) GetKey(ctx context.Context, setId, keyId string) (*jose.JSONWebKeySet, error)
- func (m *SQLManager) GetKeySet(ctx context.Context, setId string) (*jose.JSONWebKeySet, error)
- func (*SQLManager) MigrateTableName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func FindKeyByPrefix ¶
func FindKeysByPrefix ¶
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func PEMBlockForKey ¶
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type KeyGenerator ¶
type Manager ¶
type Manager interface { AddKey(ctx context.Context, setId string, key *jose.JSONWebKey) error AddKeySet(ctx context.Context, setId string, keys *jose.JSONWebKeySet) error GetKey(ctx context.Context, setId, keyId string) (*jose.JSONWebKeySet, error) GetKeySet(ctx context.Context, setId string) (*jose.JSONWebKeySet, error) DeleteKey(ctx context.Context, setId, keyId string) error DeleteKeySet(ctx context.Context, setId string) error }
type MemoryManager ¶
func NewMemoryManager ¶
func NewMemoryManager() *MemoryManager
func (*MemoryManager) AddKey ¶
func (m *MemoryManager) AddKey(ctx context.Context, setId string, key *jose.JSONWebKey) error
func (*MemoryManager) AddKeySet ¶
func (m *MemoryManager) AddKeySet(ctx context.Context, setId string, keys *jose.JSONWebKeySet) error
func (*MemoryManager) DeleteKey ¶
func (m *MemoryManager) DeleteKey(ctx context.Context, setId, keyId string) error
func (*MemoryManager) DeleteKeySet ¶
func (m *MemoryManager) DeleteKeySet(ctx context.Context, setId string) error
type RS256Generator ¶
type RS256Generator struct {
KeyLength int
}
func (*RS256Generator) Generate ¶
func (g *RS256Generator) Generate(id, use string) (*jose.JSONWebKeySet, error)
type SQLManager ¶
type SQLManager struct {
// contains filtered or unexported fields
}
func NewSQLManager ¶
func NewSQLManager(db *sqlx.DB, provider Provider) *SQLManager
func (*SQLManager) AddKey ¶
func (m *SQLManager) AddKey(ctx context.Context, setId string, key *jose.JSONWebKey) error
func (*SQLManager) AddKeySet ¶
func (m *SQLManager) AddKeySet(ctx context.Context, setId string, keys *jose.JSONWebKeySet) error
func (*SQLManager) DeleteKey ¶
func (m *SQLManager) DeleteKey(ctx context.Context, setId, keyId string) error
func (*SQLManager) DeleteKeySet ¶
func (m *SQLManager) DeleteKeySet(ctx context.Context, setId string) error
func (*SQLManager) GetKey ¶
func (m *SQLManager) GetKey(ctx context.Context, setId, keyId string) (*jose.JSONWebKeySet, error)
func (*SQLManager) GetKeySet ¶
func (m *SQLManager) GetKeySet(ctx context.Context, setId string) (*jose.JSONWebKeySet, error)
func (*SQLManager) MigrateTableName ¶
func (*SQLManager) MigrateTableName() string