Documentation
¶
Index ¶
- Constants
- type Backend
- type ClientDeleter
- type ClientGetter
- type ClientReader
- type ClientSetter
- type ConfigStore
- type EventSender
- type FlagsProvider
- type Impl
- func (b *Impl) DeleteClient(name string)
- func (b *Impl) Flags() flags.Flags
- func (b *Impl) GetClient(name string) g.Client
- func (b *Impl) GetClientByName(ctx context.Context, s logical.Storage, name string) (client g.Client, err error)
- func (b *Impl) GetConfig(ctx context.Context, s logical.Storage, name string) (*modelConfig.EntryConfig, error)
- func (b *Impl) GetRole(ctx context.Context, s logical.Storage, name string) (*role.Role, error)
- func (b *Impl) Init(ctx context.Context, conf *logical.BackendConfig, opts ...InitOption) error
- func (b *Impl) LockForKey(path, key string) *locksutil.LockEntry
- func (b *Impl) SaveConfig(ctx context.Context, s logical.Storage, config *modelConfig.EntryConfig) error
- func (b *Impl) SendEvent(ctx context.Context, eventType event.EventType, metadata map[string]string) error
- func (b *Impl) SetClient(client g.Client, name string)
- func (b *Impl) UpdateFlags(fn func(*flags.Flags))
- type InitOption
- type InvalidateHandler
- type Locker
- type Logging
- type PathProvider
- type PeriodicHandler
- type RoleStore
- type WriteSafeReplicationState
Constants ¶
const ( DefaultConfigFieldAccessTokenMaxTTL = 7 * 24 * time.Hour DefaultConfigFieldAccessTokenRotate = config.DefaultAutoRotateBeforeMinTTL DefaultRoleFieldAccessTokenMaxTTL = 24 * time.Hour DefaultAccessTokenMinTTL = 24 * time.Hour DefaultAccessTokenMaxPossibleTTL = 365 * 24 * time.Hour DefaultConfigName = "default" // PathConfigStorage is the storage key prefix for config entries. PathConfigStorage = "config" // PathRoleStorage is the storage key prefix for role entries. PathRoleStorage = "roles" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
Logging
FlagsProvider
ClientReader
ClientGetter
ClientSetter
ClientDeleter
Locker
ConfigStore
RoleStore
EventSender
WriteSafeReplicationState
}
type ClientDeleter ¶
type ClientDeleter interface {
DeleteClient(name string)
}
ClientDeleter removes a client from the cache.
type ClientGetter ¶
ClientGetter provides direct cache access to a stored client.
type ClientReader ¶
type ClientReader interface {
GetClientByName(ctx context.Context, s logical.Storage, name string) (gitlab.Client, error)
}
ClientReader provides read-only client access by config name.
type ClientSetter ¶
ClientSetter stores a client in the cache.
type ConfigStore ¶
type ConfigStore interface {
GetConfig(ctx context.Context, s logical.Storage, name string) (*config.EntryConfig, error)
SaveConfig(ctx context.Context, s logical.Storage, cfg *config.EntryConfig) error
}
ConfigStore provides config CRUD operations.
type EventSender ¶
type EventSender interface {
SendEvent(ctx context.Context, eventType event.EventType, metadata map[string]string) error
}
EventSender abstracts sending audit/events from the backend.
type FlagsProvider ¶
FlagsProvider provides read and update access to runtime flags.
type Impl ¶
Impl is the concrete implementation of the Backend interface.
func (*Impl) DeleteClient ¶
func (*Impl) GetClientByName ¶
func (*Impl) GetConfig ¶
func (b *Impl) GetConfig(ctx context.Context, s logical.Storage, name string) (*modelConfig.EntryConfig, error)
func (*Impl) Init ¶
func (b *Impl) Init(ctx context.Context, conf *logical.BackendConfig, opts ...InitOption) error
Init wires up the framework.Backend with paths from the registered providers, secrets, special paths, and periodic/invalidate dispatchers.
func (*Impl) SaveConfig ¶
func (b *Impl) SaveConfig(ctx context.Context, s logical.Storage, config *modelConfig.EntryConfig) error
func (*Impl) UpdateFlags ¶
type InitOption ¶
type InitOption func(*initConfig)
InitOption is a functional option for configuring backend initialization.
func WithLocalStorage ¶
func WithLocalStorage(paths ...string) InitOption
WithLocalStorage specifies storage paths that should be stored locally.
func WithProviders ¶
func WithProviders(p ...PathProvider) InitOption
WithProviders registers path providers with the backend.
func WithSealWrapStorage ¶
func WithSealWrapStorage(paths ...string) InitOption
WithSealWrapStorage specifies storage paths that should be seal-wrapped.
func WithSecrets ¶
func WithSecrets(s ...*framework.Secret) InitOption
WithSecrets registers framework secrets with the backend.
func WithVersion ¶
func WithVersion(v string) InitOption
WithVersion sets the running version of the backend.
type InvalidateHandler ¶
InvalidateHandler is optionally implemented by PathProviders that need to react to storage key invalidation events.
type PathProvider ¶
PathProvider provides framework paths to register with the backend.
type PeriodicHandler ¶
PeriodicHandler is optionally implemented by PathProviders that need periodic work. The backend checks WriteSafeReplicationState() centrally before dispatching — handlers are only called when writes are safe.
type RoleStore ¶
type RoleStore interface {
GetRole(ctx context.Context, s logical.Storage, name string) (*role.Role, error)
}
RoleStore provides role read operations.
type WriteSafeReplicationState ¶
type WriteSafeReplicationState interface {
WriteSafeReplicationState() bool
}