Documentation
¶
Overview ¶
Package persistence is a generated GoMock package.
Package persistence defines the Store abstraction used to save and load ApplicationGraphResponse artifacts. Concrete backends (git, graphdb, ...) live in sub-packages.
Index ¶
- Variables
- type Key
- type MockStore
- func (m *MockStore) Delete(arg0 context.Context, arg1 Key) error
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) List(arg0 context.Context, arg1 string) ([]Key, error)
- func (m *MockStore) Load(arg0 context.Context, arg1 Key) (*v20250801preview.ApplicationGraphResponse, error)
- func (m *MockStore) Save(arg0 context.Context, arg1 Key, ...) error
- type MockStoreDeleteCall
- type MockStoreListCall
- type MockStoreLoadCall
- type MockStoreMockRecorder
- func (mr *MockStoreMockRecorder) Delete(arg0, arg1 any) *MockStoreDeleteCall
- func (mr *MockStoreMockRecorder) List(arg0, arg1 any) *MockStoreListCall
- func (mr *MockStoreMockRecorder) Load(arg0, arg1 any) *MockStoreLoadCall
- func (mr *MockStoreMockRecorder) Save(arg0, arg1, arg2, arg3 any) *MockStoreSaveCall
- type MockStoreSaveCall
- type SaveOptions
- type Store
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("persistence: not found")
ErrNotFound is returned by Store.Load when no graph exists for the key.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct {
// Namespace groups related graphs (e.g. a branch prefix or DB collection).
Namespace string
// Name identifies the graph within the namespace.
Name string
}
Key identifies a persisted graph within a Store.
The meaning of the fields is backend-specific:
- For the git backend, Namespace maps to a branch prefix and Name to the file path inside the branch.
- For a future graph DB backend, these fields map to database/collection identifiers.
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
MockStore is a mock of Store interface.
func NewMockStore ¶
func NewMockStore(ctrl *gomock.Controller) *MockStore
NewMockStore creates a new mock instance.
func (*MockStore) EXPECT ¶
func (m *MockStore) EXPECT() *MockStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStore) Load ¶
func (m *MockStore) Load(arg0 context.Context, arg1 Key) (*v20250801preview.ApplicationGraphResponse, error)
Load mocks base method.
func (*MockStore) Save ¶
func (m *MockStore) Save(arg0 context.Context, arg1 Key, arg2 *v20250801preview.ApplicationGraphResponse, arg3 SaveOptions) error
Save mocks base method.
type MockStoreDeleteCall ¶
MockStoreDeleteCall wrap *gomock.Call
func (*MockStoreDeleteCall) Do ¶
func (c *MockStoreDeleteCall) Do(f func(context.Context, Key) error) *MockStoreDeleteCall
Do rewrite *gomock.Call.Do
func (*MockStoreDeleteCall) DoAndReturn ¶
func (c *MockStoreDeleteCall) DoAndReturn(f func(context.Context, Key) error) *MockStoreDeleteCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockStoreDeleteCall) Return ¶
func (c *MockStoreDeleteCall) Return(arg0 error) *MockStoreDeleteCall
Return rewrite *gomock.Call.Return
type MockStoreListCall ¶
MockStoreListCall wrap *gomock.Call
func (*MockStoreListCall) Do ¶
func (c *MockStoreListCall) Do(f func(context.Context, string) ([]Key, error)) *MockStoreListCall
Do rewrite *gomock.Call.Do
func (*MockStoreListCall) DoAndReturn ¶
func (c *MockStoreListCall) DoAndReturn(f func(context.Context, string) ([]Key, error)) *MockStoreListCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockStoreListCall) Return ¶
func (c *MockStoreListCall) Return(arg0 []Key, arg1 error) *MockStoreListCall
Return rewrite *gomock.Call.Return
type MockStoreLoadCall ¶
MockStoreLoadCall wrap *gomock.Call
func (*MockStoreLoadCall) Do ¶
func (c *MockStoreLoadCall) Do(f func(context.Context, Key) (*v20250801preview.ApplicationGraphResponse, error)) *MockStoreLoadCall
Do rewrite *gomock.Call.Do
func (*MockStoreLoadCall) DoAndReturn ¶
func (c *MockStoreLoadCall) DoAndReturn(f func(context.Context, Key) (*v20250801preview.ApplicationGraphResponse, error)) *MockStoreLoadCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockStoreLoadCall) Return ¶
func (c *MockStoreLoadCall) Return(arg0 *v20250801preview.ApplicationGraphResponse, arg1 error) *MockStoreLoadCall
Return rewrite *gomock.Call.Return
type MockStoreMockRecorder ¶
type MockStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreMockRecorder is the mock recorder for MockStore.
func (*MockStoreMockRecorder) Delete ¶
func (mr *MockStoreMockRecorder) Delete(arg0, arg1 any) *MockStoreDeleteCall
Delete indicates an expected call of Delete.
func (*MockStoreMockRecorder) List ¶
func (mr *MockStoreMockRecorder) List(arg0, arg1 any) *MockStoreListCall
List indicates an expected call of List.
func (*MockStoreMockRecorder) Load ¶
func (mr *MockStoreMockRecorder) Load(arg0, arg1 any) *MockStoreLoadCall
Load indicates an expected call of Load.
func (*MockStoreMockRecorder) Save ¶
func (mr *MockStoreMockRecorder) Save(arg0, arg1, arg2, arg3 any) *MockStoreSaveCall
Save indicates an expected call of Save.
type MockStoreSaveCall ¶
MockStoreSaveCall wrap *gomock.Call
func (*MockStoreSaveCall) Do ¶
func (c *MockStoreSaveCall) Do(f func(context.Context, Key, *v20250801preview.ApplicationGraphResponse, SaveOptions) error) *MockStoreSaveCall
Do rewrite *gomock.Call.Do
func (*MockStoreSaveCall) DoAndReturn ¶
func (c *MockStoreSaveCall) DoAndReturn(f func(context.Context, Key, *v20250801preview.ApplicationGraphResponse, SaveOptions) error) *MockStoreSaveCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockStoreSaveCall) Return ¶
func (c *MockStoreSaveCall) Return(arg0 error) *MockStoreSaveCall
Return rewrite *gomock.Call.Return
type SaveOptions ¶
type SaveOptions struct {
// Message is a human-readable description of the change (e.g. git commit
// message).
Message string
// Labels are free-form key/value pairs attached to the saved graph.
Labels map[string]string
}
SaveOptions contains optional metadata applied during Save.
type Store ¶
type Store interface {
// Save persists graph under key. Implementations should be idempotent
// for identical (key, graph) pairs.
Save(ctx context.Context, key Key, graph *corerpv20250801preview.ApplicationGraphResponse, opts SaveOptions) error
// Load returns the graph previously stored under key, or ErrNotFound.
Load(ctx context.Context, key Key) (*corerpv20250801preview.ApplicationGraphResponse, error)
// List returns keys whose Namespace matches the supplied value. An empty
// namespace lists all keys.
List(ctx context.Context, namespace string) ([]Key, error)
// Delete removes the graph stored under key. Deleting a missing key
// must return ErrNotFound.
Delete(ctx context.Context, key Key) error
}
Store persists ApplicationGraphResponse artifacts.
Implementations must be safe for concurrent use by multiple goroutines.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package git provides a persistence.Store backed by an orphan branch in a git repository.
|
Package git provides a persistence.Store backed by an orphan branch in a git repository. |
|
Package graphdb is a placeholder for a future persistence.Store implementation backed by a graph database (e.g.
|
Package graphdb is a placeholder for a future persistence.Store implementation backed by a graph database (e.g. |