Documentation ¶
Overview ¶
Package etcd provides an implementation of state.State in etcd.
Index ¶
- func ErrAlreadyExists(r resource.Reference) error
- func ErrNotFound(r resource.Pointer) error
- func ErrOwnerConflict(r resource.Reference, owner string) error
- func ErrPendingFinalizers(r resource.Metadata) error
- func ErrPhaseConflict(r resource.Reference, expectedPhase resource.Phase) error
- func ErrUnsupported(operation string) error
- func ErrVersionConflict(r resource.Pointer, expected, found int64) error
- type Client
- type State
- func (st *State) Create(ctx context.Context, res resource.Resource, opts ...state.CreateOption) error
- func (st *State) Destroy(ctx context.Context, resourcePointer resource.Pointer, ...) error
- func (st *State) Get(ctx context.Context, resourcePointer resource.Pointer, opts ...state.GetOption) (resource.Resource, error)
- func (st *State) List(ctx context.Context, resourceKind resource.Kind, opts ...state.ListOption) (resource.List, error)
- func (st *State) Update(ctx context.Context, res resource.Resource, opts ...state.UpdateOption) error
- func (st *State) Watch(ctx context.Context, resourcePointer resource.Pointer, ch chan<- state.Event, ...) error
- func (st *State) WatchKind(ctx context.Context, resourceKind resource.Kind, ch chan<- state.Event, ...) error
- func (st *State) WatchKindAggregated(ctx context.Context, resourceKind resource.Kind, ch chan<- []state.Event, ...) error
- type StateOption
- type StateOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrAlreadyExists ¶
ErrAlreadyExists generates error compatible with state.ErrConflict.
func ErrNotFound ¶
ErrNotFound generates error compatible with state.ErrNotFound.
func ErrOwnerConflict ¶
ErrOwnerConflict generates error compatible with state.ErrConflict.
func ErrPendingFinalizers ¶
ErrPendingFinalizers generates error compatible with state.ErrConflict.
func ErrPhaseConflict ¶
ErrPhaseConflict generates error compatible with ErrConflict.
func ErrUnsupported ¶
ErrUnsupported generates error compatible with state.ErrUnsupported.
Types ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
State implements state.CoreState.
func NewState ¶
func NewState(cli Client, marshaler store.Marshaler, opts ...StateOption) *State
NewState creates new State with default options.
func (*State) Create ¶
func (st *State) Create(ctx context.Context, res resource.Resource, opts ...state.CreateOption) error
Create a resource.
func (*State) Destroy ¶
func (st *State) Destroy(ctx context.Context, resourcePointer resource.Pointer, opts ...state.DestroyOption) error
Destroy a resource.
func (*State) Get ¶
func (st *State) Get(ctx context.Context, resourcePointer resource.Pointer, opts ...state.GetOption) (resource.Resource, error)
Get a resource.
func (*State) List ¶
func (st *State) List(ctx context.Context, resourceKind resource.Kind, opts ...state.ListOption) (resource.List, error)
List resources.
func (*State) Update ¶
func (st *State) Update(ctx context.Context, res resource.Resource, opts ...state.UpdateOption) error
Update a resource.
func (*State) Watch ¶
func (st *State) Watch(ctx context.Context, resourcePointer resource.Pointer, ch chan<- state.Event, opts ...state.WatchOption) error
Watch a resource.
type StateOption ¶
type StateOption func(options *StateOptions)
StateOption applies settings to StateOptions.
func WithKeyPrefix ¶
func WithKeyPrefix(keyPrefix string) StateOption
WithKeyPrefix sets the global prefix to be used in the etcd keys for StateOptions. Defaults to "/cosi" if not specified.
func WithSalt ¶
func WithSalt(salt []byte) StateOption
WithSalt sets the salt to be used in the etcd keys for StateOptions.
type StateOptions ¶
type StateOptions struct {
// contains filtered or unexported fields
}
StateOptions configure inmem.State.
func DefaultStateOptions ¶
func DefaultStateOptions() StateOptions
DefaultStateOptions returns default value of StateOptions.