configstore

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0, BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Overview

Package configstore provides a read-only interface to config stores. Refer to https://developer.fastly.com/reference/api/services/resources/config-store/ for more information.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrStoreNotFound indicates the named config store doesn't exist.
	ErrStoreNotFound = errors.New("config store not found")

	// ErrStoreNameEmpty indicates the given config store name
	// was empty.
	ErrStoreNameEmpty = errors.New("config store name was empty")

	// ErrStoreNameInvalid indicates the given config store name
	// was invalid.
	ErrStoreNameInvalid = errors.New("config store name contained invalid characters")

	// ErrStoreNameTooLong indicates the given config store name
	// was too long.
	ErrStoreNameTooLong = errors.New("config store name too long")

	// ErrKeyNotFound indicates a key isn't in a config store.
	ErrKeyNotFound = errors.New("key not found")

	// ErrUnexpected indicates an unexpected error occurred.
	ErrUnexpected = errors.New("unexpected error")
)

Functions

This section is empty.

Types

type Store

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

Store is a read-only representation of a config store.

func Open

func Open(name string) (*Store, error)

Open returns a config store with the given name. Names are case sensitive.

func (*Store) Get

func (s *Store) Get(key string) (string, error)

Get returns the value in the config store with the given key, if it exists.

func (*Store) GetBytes added in v1.3.2

func (s *Store) GetBytes(key string) ([]byte, error)

GetBytes returns the value in the config store for the given key, if it exists, as a byte slice.

func (*Store) Has added in v1.3.2

func (s *Store) Has(key string) (bool, error)

Has returns true if the key exists in the config store, without allocating space to read a value.

Jump to

Keyboard shortcuts

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