setting

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SettingNotFound is the status code returned when a setting is not found.
	SettingNotFound = 404
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client contains methods to call the Azure App Config REST API and base settings for handling the requests.

func NewClient

func NewClient(appConfiguration string, cred auth.Credential, options ...ClientOption) *Client

NewClient creates and returns a new Client.

func (Client) Get

func (c Client) Get(ctx context.Context, key string, options ...Option) (Setting, error)

Get a setting.

func (Client) GetSettings

func (c Client) GetSettings(keys []string, options ...Option) (map[string]Setting, error)

GetSettings get settings (key-values) by keys.

type ClientOption

type ClientOption func(c *Client)

ClientOption is a function that sets options to *Client.

func WithConcurrency

func WithConcurrency(n int) ClientOption

WithConcurrency sets the concurrency for secret retrieval.

func WithTimeout

func WithTimeout(d time.Duration) ClientOption

WithTimeout sets timeout for secret retreival.

type Option

type Option func(o *Options)

Option is a function that sets options for client operations.

func WithLabel

func WithLabel(label string) Option

WithLabel sets label on the on a setting request.

type Options

type Options struct {
	Label string
}

Options for client operations.

type Setting

type Setting struct {
	Value string `json:"value"`
	Label string `json:"label"`
}

Setting represents a setting as returned from the App Config REST API.

func (Setting) GetValue

func (s Setting) GetValue() string

GetValue returns the Value of the Setting.

Jump to

Keyboard shortcuts

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