Documentation ¶
Index ¶
- type ContextExtractor
- type Logger
- type OrgIDContextExtractor
- type OrgIDContextExtractorFunc
- type ReadOnlyOrganizationalSecretStore
- type ReadWriteOrganizationalSecretStore
- type SecretStore
- func (s *SecretStore) Delete(ctx context.Context, secretID string) error
- func (s *SecretStore) GetIDByName(ctx context.Context, secretName string) (string, error)
- func (s *SecretStore) GetNameByID(ctx context.Context, secretID string) (string, error)
- func (s *SecretStore) GetSecretValues(ctx context.Context, secretID string) (map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextExtractor ¶
ContextExtractor extracts log fields from a context.
type Logger ¶
type Logger struct { logur.LoggerFacade // contains filtered or unexported fields }
Logger wraps a logur logger and exposes it under a custom interface.
func NewContextAwareLogger ¶
func NewContextAwareLogger(logger logur.LoggerFacade, extractor ContextExtractor) *Logger
NewContextAwareLogger returns a new Logger instance that can extract information from a context.
func NewLogger ¶
func NewLogger(logger logur.LoggerFacade) *Logger
NewLogger returns a new Logger instance.
func (*Logger) WithContext ¶
WithContext annotates a logger with a context.
type OrgIDContextExtractor ¶
type OrgIDContextExtractor interface { // GetOrganizationID extracts an organization ID from a context (if there is any). GetOrganizationID(ctx context.Context) (uint, bool) }
OrgIDContextExtractor extracts an organization ID from a context (if there is any).
type OrgIDContextExtractorFunc ¶
OrgIDContextExtractorFunc converts an ordinary function to an OrgIDContextExtractor (given it's method signature is compatible with the interface).
func (OrgIDContextExtractorFunc) GetOrganizationID ¶
func (f OrgIDContextExtractorFunc) GetOrganizationID(ctx context.Context) (uint, bool)
GetOrganizationID implements the OrgIDContextExtractor interface.
type ReadOnlyOrganizationalSecretStore ¶
type ReadOnlyOrganizationalSecretStore interface { // Get returns a secret in the internal format of the secret store. Get(organizationID uint, secretID string) (*secret.SecretItemResponse, error) }
type ReadWriteOrganizationalSecretStore ¶
type ReadWriteOrganizationalSecretStore interface { ReadOnlyOrganizationalSecretStore Store(organizationID uint, request *secret.CreateSecretRequest) (string, error) // GetByName returns a secret in the internal format of the secret store based on secret name. GetByName(organizationID uint, name string) (*secret.SecretItemResponse, error) Delete(organizationID uint, secretID string) error }
ReadWriteOrganizationalSecretStore is the global secret store that stores values under a compound key: the organization ID and a secret ID.
type SecretStore ¶
type SecretStore struct {
// contains filtered or unexported fields
}
SecretStore implements the common.SecretStore interface and acts as a lightweight wrapper around the global secret store.
func NewSecretStore ¶
func NewSecretStore(store ReadWriteOrganizationalSecretStore, extractor OrgIDContextExtractor) *SecretStore
NewSecretStore returns a new SecretStore instance.
func (*SecretStore) Delete ¶
func (s *SecretStore) Delete(ctx context.Context, secretID string) error
func (*SecretStore) GetIDByName ¶
func (*SecretStore) GetNameByID ¶
func (*SecretStore) GetSecretValues ¶
func (s *SecretStore) GetSecretValues(ctx context.Context, secretID string) (map[string]string, error)
GetSecretValues implements the common.SecretStore interface.