Documentation
¶
Index ¶
- Variables
- func NewRetainedID() (string, error)
- type BindRequest
- type DeleteFailedRequest
- type DeleteRequest
- type ListRequest
- type MemoryStore
- func (s *MemoryStore) Delete(_ context.Context, retainedID string) error
- func (s *MemoryStore) ExpireBefore(_ context.Context, now time.Time) ([]Record, error)
- func (s *MemoryStore) Get(_ context.Context, retainedID string) (Record, error)
- func (s *MemoryStore) List(_ context.Context, req ListRequest) ([]Record, error)
- func (s *MemoryStore) MarkBound(_ context.Context, req BindRequest) (Record, error)
- func (s *MemoryStore) MarkDeleteFailed(_ context.Context, req DeleteFailedRequest) (Record, error)
- func (s *MemoryStore) MarkDeleted(_ context.Context, req DeleteRequest) (Record, error)
- func (s *MemoryStore) Retain(_ context.Context, req RetainRequest) (Record, error)
- func (s *MemoryStore) Touch(_ context.Context, req TouchRequest) (Record, error)
- type Record
- type RetainRequest
- type SQLiteStore
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) Delete(ctx context.Context, retainedID string) error
- func (s *SQLiteStore) ExpireBefore(ctx context.Context, now time.Time) ([]Record, error)
- func (s *SQLiteStore) Get(ctx context.Context, retainedID string) (Record, error)
- func (s *SQLiteStore) List(ctx context.Context, req ListRequest) ([]Record, error)
- func (s *SQLiteStore) MarkBound(ctx context.Context, req BindRequest) (Record, error)
- func (s *SQLiteStore) MarkDeleteFailed(ctx context.Context, req DeleteFailedRequest) (Record, error)
- func (s *SQLiteStore) MarkDeleted(ctx context.Context, req DeleteRequest) (Record, error)
- func (s *SQLiteStore) Retain(ctx context.Context, req RetainRequest) (Record, error)
- func (s *SQLiteStore) Touch(ctx context.Context, req TouchRequest) (Record, error)
- type State
- type Store
- type TouchRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("retained data record not found") ErrInvalidRecord = errors.New("retained data record is invalid") )
Functions ¶
func NewRetainedID ¶
Types ¶
type BindRequest ¶
type DeleteFailedRequest ¶
type DeleteRequest ¶
type ListRequest ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) Delete ¶
func (s *MemoryStore) Delete(_ context.Context, retainedID string) error
func (*MemoryStore) ExpireBefore ¶
func (*MemoryStore) List ¶
func (s *MemoryStore) List(_ context.Context, req ListRequest) ([]Record, error)
func (*MemoryStore) MarkBound ¶
func (s *MemoryStore) MarkBound(_ context.Context, req BindRequest) (Record, error)
func (*MemoryStore) MarkDeleteFailed ¶
func (s *MemoryStore) MarkDeleteFailed(_ context.Context, req DeleteFailedRequest) (Record, error)
func (*MemoryStore) MarkDeleted ¶
func (s *MemoryStore) MarkDeleted(_ context.Context, req DeleteRequest) (Record, error)
func (*MemoryStore) Retain ¶
func (s *MemoryStore) Retain(_ context.Context, req RetainRequest) (Record, error)
func (*MemoryStore) Touch ¶
func (s *MemoryStore) Touch(_ context.Context, req TouchRequest) (Record, error)
type Record ¶
type Record struct {
RetainedID string `json:"retained_id"`
SourcePluginInstanceID string `json:"source_plugin_instance_id"`
BoundPluginInstanceID string `json:"bound_plugin_instance_id,omitempty"`
PublisherID string `json:"publisher_id"`
PluginID string `json:"plugin_id"`
Version string `json:"version"`
PackageHash string `json:"package_hash"`
ManifestHash string `json:"manifest_hash"`
State State `json:"state"`
StorageRetained bool `json:"storage_retained"`
SettingsRetained bool `json:"settings_retained"`
UsageBytes int64 `json:"usage_bytes,omitempty"`
DeleteAfter *time.Time `json:"delete_after,omitempty"`
DeleteError string `json:"delete_error,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
RetainedAt time.Time `json:"retained_at"`
UpdatedAt time.Time `json:"updated_at"`
BoundAt *time.Time `json:"bound_at,omitempty"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
LastAccessedAt *time.Time `json:"last_accessed_at,omitempty"`
}
type RetainRequest ¶
type RetainRequest struct {
RetainedID string `json:"retained_id"`
SourcePluginInstanceID string `json:"source_plugin_instance_id"`
PublisherID string `json:"publisher_id"`
PluginID string `json:"plugin_id"`
Version string `json:"version"`
PackageHash string `json:"package_hash"`
ManifestHash string `json:"manifest_hash"`
StorageRetained bool `json:"storage_retained"`
SettingsRetained bool `json:"settings_retained"`
UsageBytes int64 `json:"usage_bytes,omitempty"`
DeleteAfter *time.Time `json:"delete_after,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
Now time.Time `json:"now,omitempty"`
}
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
func NewSQLiteStore ¶
func NewSQLiteStore(ctx context.Context, path string) (*SQLiteStore, error)
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
func (*SQLiteStore) Delete ¶
func (s *SQLiteStore) Delete(ctx context.Context, retainedID string) error
func (*SQLiteStore) ExpireBefore ¶
func (*SQLiteStore) List ¶
func (s *SQLiteStore) List(ctx context.Context, req ListRequest) ([]Record, error)
func (*SQLiteStore) MarkBound ¶
func (s *SQLiteStore) MarkBound(ctx context.Context, req BindRequest) (Record, error)
func (*SQLiteStore) MarkDeleteFailed ¶
func (s *SQLiteStore) MarkDeleteFailed(ctx context.Context, req DeleteFailedRequest) (Record, error)
func (*SQLiteStore) MarkDeleted ¶
func (s *SQLiteStore) MarkDeleted(ctx context.Context, req DeleteRequest) (Record, error)
func (*SQLiteStore) Retain ¶
func (s *SQLiteStore) Retain(ctx context.Context, req RetainRequest) (Record, error)
func (*SQLiteStore) Touch ¶
func (s *SQLiteStore) Touch(ctx context.Context, req TouchRequest) (Record, error)
type Store ¶
type Store interface {
Retain(ctx context.Context, req RetainRequest) (Record, error)
Get(ctx context.Context, retainedID string) (Record, error)
List(ctx context.Context, req ListRequest) ([]Record, error)
MarkBound(ctx context.Context, req BindRequest) (Record, error)
MarkDeleted(ctx context.Context, req DeleteRequest) (Record, error)
MarkDeleteFailed(ctx context.Context, req DeleteFailedRequest) (Record, error)
Touch(ctx context.Context, req TouchRequest) (Record, error)
ExpireBefore(ctx context.Context, now time.Time) ([]Record, error)
Delete(ctx context.Context, retainedID string) error
}
type TouchRequest ¶
Click to show internal directories.
Click to hide internal directories.