configuration

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 1 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetRequest

type GetRequest struct {
	Keys     []string          `json:"keys"`
	Metadata map[string]string `json:"metadata"`
}

GetRequest is the object describing a request to get configuration.

type GetResponse

type GetResponse struct {
	Items []*Item `json:"items"`
}

GetResponse is the request object for getting configuration.

type Item

type Item struct {
	Key      string            `json:"key"`
	Value    string            `json:"value,omitempty"`
	Version  string            `json:"version,omitempty"`
	Metadata map[string]string `json:"metadata,omitempty"`
}

Item represents a configuration item with name, content and other information.

type Metadata

type Metadata struct {
	Properties map[string]string `json:"properties"`
}

Metadata contains a configuration store specific set of metadata property.

type Store

type Store interface {
	// Init configuration store.
	Init(metadata Metadata) error

	// Get configuration.
	Get(ctx context.Context, req *GetRequest) (*GetResponse, error)

	// Subscribe configuration by update event.
	Subscribe(ctx context.Context, req *SubscribeRequest, handler UpdateHandler) (string, error)

	// Unsubscribe configuration with keys
	Unsubscribe(ctx context.Context, req *UnsubscribeRequest) error
}

Store is an interface to perform operations on store.

type SubscribeRequest

type SubscribeRequest struct {
	Keys     []string          `json:"keys"`
	Metadata map[string]string `json:"metadata"`
}

SubscribeRequest is the object describing a request to subscribe configuration.

type UnsubscribeRequest added in v1.7.0

type UnsubscribeRequest struct {
	ID string `json:"id"`
}

UnsubscribeRequest is the object describing a request to unsubscribe configuration.

type UpdateEvent

type UpdateEvent struct {
	ID    string  `json:"id"`
	Items []*Item `json:"items"`
}

UpdateEvent is the object describing a configuration update event.

type UpdateHandler

type UpdateHandler func(ctx context.Context, e *UpdateEvent) error

UpdateHandler is the handler used to send event to daprd.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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