Documentation
¶
Overview ¶
Package memory provides in-process resource adapters for tests and local-first demos.
Index ¶
- type Base
- func (b *Base) AdvanceEpoch(reason string) (resource.EpochAdvance, error)
- func (b *Base) Capabilities() resource.ResourceCapabilities
- func (b *Base) Describe() resource.Description
- func (b *Base) Epoch() resource.ResourceEpoch
- func (b *Base) Health(ctx context.Context) resource.ResourceHealth
- func (b *Base) ID() resource.ResourceID
- func (b *Base) Kind() resource.Kind
- func (b *Base) Mutate(ctx context.Context, op string, attrs map[string]string) (resource.Evidence, error)
- func (b *Base) SetHealth(h resource.ResourceHealth)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base is a simple Resource implementation.
func New ¶
func New(id resource.ResourceID, desc resource.Description, caps resource.ResourceCapabilities) *Base
New constructs a Base resource. Capabilities default to SupportsHealth only.
func (*Base) AdvanceEpoch ¶
func (b *Base) AdvanceEpoch(reason string) (resource.EpochAdvance, error)
AdvanceEpoch advances local epoch with reason.
func (*Base) Capabilities ¶
func (b *Base) Capabilities() resource.ResourceCapabilities
func (*Base) Describe ¶
func (b *Base) Describe() resource.Description
func (*Base) Epoch ¶
func (b *Base) Epoch() resource.ResourceEpoch
Epoch returns the in-memory epoch.
func (*Base) ID ¶
func (b *Base) ID() resource.ResourceID
func (*Base) Mutate ¶
func (b *Base) Mutate(ctx context.Context, op string, attrs map[string]string) (resource.Evidence, error)
Mutate implements MutableResource when SupportsOwnership or fencing is claimed; otherwise returns ErrCapabilityClaimed.
func (*Base) SetHealth ¶
func (b *Base) SetHealth(h resource.ResourceHealth)
SetHealth overrides health for tests.
Click to show internal directories.
Click to hide internal directories.