Documentation
¶
Index ¶
- Variables
- type MySQLStorage
- func (s *MySQLStorage) RetrieveAssignerProfile(ctx context.Context, name string) (profileUUID string, modTime time.Time, err error)
- func (s *MySQLStorage) RetrieveAuthTokens(ctx context.Context, name string) (*client.OAuth1Tokens, error)
- func (s *MySQLStorage) RetrieveConfig(ctx context.Context, name string) (*client.Config, error)
- func (s *MySQLStorage) RetrieveCursor(ctx context.Context, name string) (string, error)
- func (s *MySQLStorage) RetrieveTokenPKI(ctx context.Context, name string) (pemCert []byte, pemKey []byte, err error)
- func (s *MySQLStorage) StoreAssignerProfile(ctx context.Context, name string, profileUUID string) error
- func (s *MySQLStorage) StoreAuthTokens(ctx context.Context, name string, tokens *client.OAuth1Tokens) error
- func (s *MySQLStorage) StoreConfig(ctx context.Context, name string, config *client.Config) error
- func (s *MySQLStorage) StoreCursor(ctx context.Context, name, cursor string) error
- func (s *MySQLStorage) StoreTokenPKI(ctx context.Context, name string, pemCert []byte, pemKey []byte) error
- type Option
Constants ¶
This section is empty.
Variables ¶
var Schema string
Schema contains the MySQL schema for the DEP storage.
Functions ¶
This section is empty.
Types ¶
type MySQLStorage ¶
type MySQLStorage struct {
// contains filtered or unexported fields
}
MySQLStorage implements a storage.AllStorage using MySQL.
func New ¶
func New(opts ...Option) (*MySQLStorage, error)
New creates and returns a new MySQLStorage.
func (*MySQLStorage) RetrieveAssignerProfile ¶
func (s *MySQLStorage) RetrieveAssignerProfile(ctx context.Context, name string) (profileUUID string, modTime time.Time, err error)
RetrieveAssignerProfile reads the assigner profile UUID and its timestamp for name DEP name.
Returns an empty profile UUID if it does not exist.
func (*MySQLStorage) RetrieveAuthTokens ¶
func (s *MySQLStorage) RetrieveAuthTokens(ctx context.Context, name string) (*client.OAuth1Tokens, error)
RetrieveAuthTokens reads the DEP OAuth tokens for name DEP name.
func (*MySQLStorage) RetrieveConfig ¶
RetrieveConfig reads the JSON DEP config of a DEP name.
Returns (nil, nil) if the DEP name does not exist, or if the config for the DEP name does not exist.
func (*MySQLStorage) RetrieveCursor ¶
RetrieveCursor reads the reads the DEP fetch and sync cursor for name DEP name.
Returns an empty cursor if the cursor does not exist.
func (*MySQLStorage) RetrieveTokenPKI ¶
func (s *MySQLStorage) RetrieveTokenPKI(ctx context.Context, name string) (pemCert []byte, pemKey []byte, err error)
RetrieveTokenPKI reads the PEM bytes for the DEP token exchange certificate and private key using name DEP name.
func (*MySQLStorage) StoreAssignerProfile ¶
func (s *MySQLStorage) StoreAssignerProfile(ctx context.Context, name string, profileUUID string) error
StoreAssignerProfile saves the assigner profile UUID for name DEP name.
func (*MySQLStorage) StoreAuthTokens ¶
func (s *MySQLStorage) StoreAuthTokens(ctx context.Context, name string, tokens *client.OAuth1Tokens) error
StoreAuthTokens saves the DEP OAuth tokens for the DEP name.
func (*MySQLStorage) StoreConfig ¶
StoreConfig saves the DEP config for name DEP name.
func (*MySQLStorage) StoreCursor ¶
func (s *MySQLStorage) StoreCursor(ctx context.Context, name, cursor string) error
StoreCursor saves the DEP fetch and sync cursor for name DEP name.
func (*MySQLStorage) StoreTokenPKI ¶
func (s *MySQLStorage) StoreTokenPKI(ctx context.Context, name string, pemCert []byte, pemKey []byte) error
StoreTokenPKI stores the PEM bytes in pemCert and pemKey for name DEP name.
type Option ¶
type Option func(*config)
Option allows configuring a MySQLStorage.
func WithDB ¶
WithDB sets a custom MySQL *sql.DB to the storage.
If set, driver passed via WithDriver is ignored.
func WithDriver ¶
WithDriver sets a custom MySQL driver for the storage.
Default driver is "mysql". Value is ignored if WithDB is used.