Documentation ¶
Index ¶
- func InitKeyValue(ctx context.Context, conn *nats.Conn, opts ...StoreOption) error
- type ApplyRequest
- type CreateRequest
- type DeleteRequest
- type DeleteResult
- type GarbageCollector
- type GetRequest
- type ListRequest
- type SchemaRequest
- type Store
- func (s *Store) Apply(ctx context.Context, req ApplyRequest) (int, error)
- func (s *Store) Close() error
- func (s *Store) Create(ctx context.Context, req CreateRequest) error
- func (s *Store) Delete(ctx context.Context, req DeleteRequest) error
- func (s *Store) Get(ctx context.Context, req GetRequest) ([]byte, error)
- func (s *Store) List(ctx context.Context, req ListRequest) (*hz.ObjectList, error)
- func (s *Store) Schema(ctx context.Context, req SchemaRequest) error
- func (s *Store) Start(ctx context.Context, conn *nats.Conn, auth *auth.Auth, opts ...StoreOption) error
- func (s *Store) Update(ctx context.Context, req UpdateRequest) error
- func (s *Store) Validate(ctx context.Context, req ValidateRequest) error
- type StoreCommand
- type StoreOption
- type UpdateRequest
- type ValidateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitKeyValue ¶
func InitKeyValue( ctx context.Context, conn *nats.Conn, opts ...StoreOption, ) error
Types ¶
type ApplyRequest ¶
type ApplyRequest struct { // Data is the actual JSON payload. Data []byte // Manager is the name of the field manager for this request. Manager string // Force will force the apply to happen even if there are conflicts. Force bool Key hz.ObjectKeyer }
type CreateRequest ¶
type CreateRequest struct { Key hz.ObjectKeyer Data []byte }
type DeleteRequest ¶
type DeleteRequest struct {
Key hz.ObjectKeyer
}
type DeleteResult ¶
type DeleteResult int
const ( DeleteResultSuccess DeleteResult = iota DeleteResultError DeleteResultFinalizers )
type GarbageCollector ¶
type GarbageCollector struct { Conn *nats.Conn KV jetstream.KeyValue // contains filtered or unexported fields }
func (*GarbageCollector) Stop ¶
func (gc *GarbageCollector) Stop()
type GetRequest ¶
type GetRequest struct {
Key hz.ObjectKeyer
}
type ListRequest ¶
type ListRequest struct {
Key hz.ObjectKeyer `json:"key,omitempty"`
}
type SchemaRequest ¶
type SchemaRequest struct{}
type Store ¶
func StartStore ¶
func (*Store) Apply ¶
Apply performs the apply operation on the given request. It returns an HTTP status code (int) indicating the result of the operation. If an error is returned, the HTTP status code is part of the error and hence the return value is ignored (use -1 for consistency).
func (*Store) List ¶
func (s *Store) List( ctx context.Context, req ListRequest, ) (*hz.ObjectList, error)
type StoreCommand ¶
type StoreCommand string
const ( StoreCommandCreate StoreCommand = "create" StoreCommandApply StoreCommand = "apply" StoreCommandGet StoreCommand = "get" StoreCommandList StoreCommand = "list" StoreCommandDelete StoreCommand = "delete" )
func (StoreCommand) String ¶
func (c StoreCommand) String() string
type StoreOption ¶
type StoreOption func(*storeOptions)
func WithMutexTTL ¶
func WithMutexTTL(ttl time.Duration) StoreOption
func WithStopTimeout ¶
func WithStopTimeout(timeout time.Duration) StoreOption
type UpdateRequest ¶
type UpdateRequest struct { Data []byte Key hz.ObjectKeyer Revision uint64 }
type ValidateRequest ¶
type ValidateRequest struct{}
Click to show internal directories.
Click to hide internal directories.