preload

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotReady indicates that one or more components are not ready and we should retry
	ErrNotReady = errors.New("cloud resources not ready")
)

Functions

This section is empty.

Types

type Data

type Data map[string]*Entry

Data is a map of key/value pairs

func NewData

func NewData() Data

NewData returns a new Data instance

func (*Data) Add

func (d *Data) Add(name string, entry Entry)

Add adds a new entry to the data

func (*Data) Get

func (d *Data) Get(name string) *Entry

Get returns an entry from the data

func (*Data) Keys

func (d *Data) Keys() []string

Keys returns a list of keys in the data

func (*Data) MarshalTo

func (d *Data) MarshalTo(w io.Writer) error

MarshalTo marshals the data to JSON

type Entry

type Entry struct {
	// Description is a human readable description of the entry
	Description string `json:"description"`
	// Value is the value of the entry
	Value interface{} `json:"value"`
}

Entry is a single entry in the preload data

func (*Entry) Marshal

func (e *Entry) Marshal() ([]byte, error)

Marshal marshals the data to JSON

type Interface

type Interface interface {
	// Load is used to load the preload data
	Load(ctx context.Context) (Data, error)
}

Interface is the external interface for the preload package

Directories

Path Synopsis
eks
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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