Documentation
¶
Index ¶
- type DB
- func (db *DB) FindAllByService(ctx context.Context, serviceID string) ([]Label, error)
- func (db *DB) SearchKeys(ctx context.Context, opts *KeySearchOptions) ([]string, error)
- func (db *DB) SearchValues(ctx context.Context, opts *ValueSearchOptions) ([]string, error)
- func (db *DB) SetTx(ctx context.Context, tx *sql.Tx, label *Label) error
- func (db *DB) UniqueKeys(ctx context.Context) ([]string, error)
- func (db *DB) UniqueKeysTx(ctx context.Context, tx *sql.Tx) ([]string, error)
- type KeySearchOptions
- type Label
- type Store
- type ValueSearchOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements the Store interface using a postgres database.
func NewDB ¶
NewDB will Set a DB backend from a sql.DB. An error will be returned if statements fail to prepare.
func (*DB) FindAllByService ¶
FindAllByService finds all labels for a particular service. It returns all key-value pairs.
func (*DB) SearchKeys ¶ added in v0.25.0
func (*DB) SearchValues ¶ added in v0.25.0
type KeySearchOptions ¶ added in v0.25.0
type KeySearchOptions struct { Search string `json:"s,omitempty"` After string `json:"a,omitempty"` // Omit specifies a list of key names to exclude from the results. Omit []string `json:"o,omitempty"` Limit int `json:"-"` }
KeySearchOptions allow filtering and paginating the list of rotations.
type Label ¶
type Label struct { Target assignment.Target Key string `json:"key"` Value string `json:"value"` }
A Label is a key-value pair assigned to a target.
type Store ¶
type Store interface { SetTx(ctx context.Context, tx *sql.Tx, label *Label) error FindAllByService(ctx context.Context, serviceID string) ([]Label, error) UniqueKeysTx(ctx context.Context, tx *sql.Tx) ([]string, error) UniqueKeys(ctx context.Context) ([]string, error) SearchKeys(ctx context.Context, opts *KeySearchOptions) ([]string, error) SearchValues(ctx context.Context, opts *ValueSearchOptions) ([]string, error) }
Store allows the lookup and management of Labels.
type ValueSearchOptions ¶ added in v0.25.0
type ValueSearchOptions struct { Key string `json:"k"` KeySearchOptions }
ValueSearchOptions allow filtering and paginating the list of rotations.
Click to show internal directories.
Click to hide internal directories.