proposal

package
v0.10.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewID

func NewID(targetID configapi.TargetID, index configapi.Index) configapi.ProposalID

NewID returns a new Proposal ID for the given target/type/version

Types

type Store

type Store interface {
	// Get gets the proposal intended for a given target ID
	Get(ctx context.Context, id configapi.ProposalID) (*configapi.Proposal, error)

	// Create creates a proposal
	Create(ctx context.Context, proposal *configapi.Proposal) error

	// Update updates a proposal
	Update(ctx context.Context, proposal *configapi.Proposal) error

	// List lists all the proposal
	List(ctx context.Context) ([]*configapi.Proposal, error)

	// Watch watches proposal changes
	Watch(ctx context.Context, ch chan<- configapi.ProposalEvent, opts ...WatchOption) error

	// UpdateStatus updates a proposal status
	UpdateStatus(ctx context.Context, proposal *configapi.Proposal) error

	Close(ctx context.Context) error
}

Store proposal store interface

func NewAtomixStore

func NewAtomixStore(client atomix.Client) (Store, error)

NewAtomixStore returns a new persistent Store

type WatchOption

type WatchOption interface {
	// contains filtered or unexported methods
}

WatchOption is a proposal option for Watch calls

func WithProposalID

func WithProposalID(id configapi.ProposalID) WatchOption

WithProposalID returns a Watch option that watches for proposals based on a given proposal ID

func WithReplay

func WithReplay() WatchOption

WithReplay returns a WatchOption that replays past changes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL