Documentation
¶
Index ¶
- Constants
- Variables
- type ArchiveRecord
- type BindRetainedRequest
- type DeleteRequest
- type EnsureRequest
- type ExportRequest
- type GetRequest
- type ImportRequest
- type MarkSecretRequest
- type MemoryState
- type MemoryStore
- func (s *MemoryStore) BindRetained(_ context.Context, req BindRetainedRequest) (Snapshot, error)
- func (s *MemoryStore) Delete(_ context.Context, req DeleteRequest) error
- func (s *MemoryStore) Ensure(_ context.Context, req EnsureRequest) (Snapshot, error)
- func (s *MemoryStore) Export(_ context.Context, req ExportRequest) (string, error)
- func (s *MemoryStore) Get(_ context.Context, req GetRequest) (Snapshot, error)
- func (s *MemoryStore) Import(_ context.Context, req ImportRequest) (Snapshot, error)
- func (s *MemoryStore) MarkSecret(_ context.Context, req MarkSecretRequest) (Snapshot, error)
- func (s *MemoryStore) Patch(_ context.Context, req PatchRequest) (Snapshot, error)
- func (s *MemoryStore) State() MemoryState
- type PatchRequest
- type Record
- type SQLiteStore
- func (s *SQLiteStore) BindRetained(ctx context.Context, req BindRetainedRequest) (Snapshot, error)
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) Delete(ctx context.Context, req DeleteRequest) error
- func (s *SQLiteStore) Ensure(ctx context.Context, req EnsureRequest) (Snapshot, error)
- func (s *SQLiteStore) Export(ctx context.Context, req ExportRequest) (string, error)
- func (s *SQLiteStore) Get(ctx context.Context, req GetRequest) (Snapshot, error)
- func (s *SQLiteStore) Import(ctx context.Context, req ImportRequest) (Snapshot, error)
- func (s *SQLiteStore) MarkSecret(ctx context.Context, req MarkSecretRequest) (Snapshot, error)
- func (s *SQLiteStore) Patch(ctx context.Context, req PatchRequest) (Snapshot, error)
- type SecretState
- type SecretValue
- type Snapshot
- type State
- type Store
Constants ¶
View Source
const ( FieldString = "string" FieldBoolean = "boolean" FieldNumber = "number" FieldInteger = "integer" FieldEnum = "enum" FieldSelect = "select" FieldSecret = "secret" )
Variables ¶
View Source
var ( ErrNotDeclared = errors.New("plugin settings are not declared") ErrInvalidSetting = errors.New("plugin setting is invalid") ErrArchiveNotFound = errors.New("plugin settings archive not found") ErrNotRetained = errors.New("plugin settings are not retained") ErrAlreadyExists = errors.New("plugin settings already exist") )
Functions ¶
This section is empty.
Types ¶
type ArchiveRecord ¶
type ArchiveRecord struct {
ArchiveRef string `json:"archive_ref"`
SourcePluginInstanceID string `json:"source_plugin_instance_id"`
IncludeSecrets bool `json:"include_secrets"`
SchemaVersion int `json:"schema_version"`
Fields []manifest.SettingFieldSpec `json:"fields"`
Values map[string]any `json:"values"`
Secrets map[string]SecretState `json:"secrets"`
SettingsRevision uint64 `json:"settings_revision"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
type BindRetainedRequest ¶
type DeleteRequest ¶
type EnsureRequest ¶
type EnsureRequest struct {
PluginInstanceID string
Spec *manifest.SettingsSpec
Now time.Time
}
type ExportRequest ¶
type GetRequest ¶
type GetRequest struct {
PluginInstanceID string
}
type ImportRequest ¶
type MarkSecretRequest ¶
type MemoryState ¶
type MemoryState struct {
NextExport int `json:"next_export,omitempty"`
Records map[string]Record `json:"records,omitempty"`
Archives map[string]ArchiveRecord `json:"archives,omitempty"`
}
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func NewMemoryStoreFromState ¶
func NewMemoryStoreFromState(state MemoryState) *MemoryStore
func (*MemoryStore) BindRetained ¶
func (s *MemoryStore) BindRetained(_ context.Context, req BindRetainedRequest) (Snapshot, error)
func (*MemoryStore) Delete ¶
func (s *MemoryStore) Delete(_ context.Context, req DeleteRequest) error
func (*MemoryStore) Ensure ¶
func (s *MemoryStore) Ensure(_ context.Context, req EnsureRequest) (Snapshot, error)
func (*MemoryStore) Export ¶
func (s *MemoryStore) Export(_ context.Context, req ExportRequest) (string, error)
func (*MemoryStore) Get ¶
func (s *MemoryStore) Get(_ context.Context, req GetRequest) (Snapshot, error)
func (*MemoryStore) Import ¶
func (s *MemoryStore) Import(_ context.Context, req ImportRequest) (Snapshot, error)
func (*MemoryStore) MarkSecret ¶
func (s *MemoryStore) MarkSecret(_ context.Context, req MarkSecretRequest) (Snapshot, error)
func (*MemoryStore) Patch ¶
func (s *MemoryStore) Patch(_ context.Context, req PatchRequest) (Snapshot, error)
func (*MemoryStore) State ¶
func (s *MemoryStore) State() MemoryState
type PatchRequest ¶
type Record ¶
type Record struct {
PluginInstanceID string `json:"plugin_instance_id"`
SchemaVersion int `json:"schema_version"`
SettingsRevision uint64 `json:"settings_revision"`
State State `json:"state"`
Fields []manifest.SettingFieldSpec `json:"fields"`
Values map[string]any `json:"values"`
Secrets map[string]SecretState `json:"secrets"`
UpdatedAt time.Time `json:"updated_at"`
RetainedAt *time.Time `json:"retained_at,omitempty"`
}
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
func NewSQLiteStore ¶
func NewSQLiteStore(ctx context.Context, path string) (*SQLiteStore, error)
func (*SQLiteStore) BindRetained ¶
func (s *SQLiteStore) BindRetained(ctx context.Context, req BindRetainedRequest) (Snapshot, error)
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
func (*SQLiteStore) Delete ¶
func (s *SQLiteStore) Delete(ctx context.Context, req DeleteRequest) error
func (*SQLiteStore) Ensure ¶
func (s *SQLiteStore) Ensure(ctx context.Context, req EnsureRequest) (Snapshot, error)
func (*SQLiteStore) Export ¶
func (s *SQLiteStore) Export(ctx context.Context, req ExportRequest) (string, error)
func (*SQLiteStore) Get ¶
func (s *SQLiteStore) Get(ctx context.Context, req GetRequest) (Snapshot, error)
func (*SQLiteStore) Import ¶
func (s *SQLiteStore) Import(ctx context.Context, req ImportRequest) (Snapshot, error)
func (*SQLiteStore) MarkSecret ¶
func (s *SQLiteStore) MarkSecret(ctx context.Context, req MarkSecretRequest) (Snapshot, error)
func (*SQLiteStore) Patch ¶
func (s *SQLiteStore) Patch(ctx context.Context, req PatchRequest) (Snapshot, error)
type SecretState ¶
type SecretValue ¶
type Store ¶
type Store interface {
Ensure(ctx context.Context, req EnsureRequest) (Snapshot, error)
Get(ctx context.Context, req GetRequest) (Snapshot, error)
Patch(ctx context.Context, req PatchRequest) (Snapshot, error)
MarkSecret(ctx context.Context, req MarkSecretRequest) (Snapshot, error)
Export(ctx context.Context, req ExportRequest) (string, error)
Import(ctx context.Context, req ImportRequest) (Snapshot, error)
Delete(ctx context.Context, req DeleteRequest) error
BindRetained(ctx context.Context, req BindRetainedRequest) (Snapshot, error)
}
Click to show internal directories.
Click to hide internal directories.