labelstore

package
v0.0.0-...-1b9946f Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("label not found")

ErrNotFound is returned when a label is not found.

Functions

This section is empty.

Types

type DeleteInput

type DeleteInput struct {
	ID        string
	DeleterID string
	Timestamp time.Time
}

type LabelStore

type LabelStore interface {
	Insert(label *api.Label) error
	Delete(*DeleteInput) error // mark label as deleted
	List(ctx context.Context, input *ListInput) ([]*api.Label, error)
	Sample(ctx context.Context, input *SampleInput) ([]*api.Label, error)
	SampleWithQuery(ctx context.Context, input *SampleWithQueryInput) ([]*api.Label, error)
	Get(ctx context.Context, id string) (*api.Label, error)
}

LabelStore is an interface for storing and retrieving labels. Labels are immutable. Once created, they cannot be updated. Labels are identified with a unique ID and are associated with a project.

type ListInput

type ListInput struct {
	ProjectID string // (required) project id
}

ListInput is the input for the List method.

type SampleInput

type SampleInput struct {
	ProjectID string // (required) project id
	BatchSize int    // (optional) number of labels to return
}

SampleInput is the input for the Sample method.

type SampleWithQueryInput

type SampleWithQueryInput struct {
	ProjectID   string                 // (required) project id
	BatchSize   int                    // (optional) number of labels to return
	Tags        []string               // (required) tags to match
	ExcludeTags []string               // (optional) tags to exclude
	All         bool                   // (optional) match all tags or any
	Payload     map[string]interface{} // (required) payload fields to match
}

SampleWithQueryInput is the input for the SampleWithQuery method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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