dataset

package
v0.0.0-...-8b43a00 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dataset

type Dataset struct {
	DatasetMeta `json:",inline"`
	Elements    map[string]Element `json:"elements,omitempty"`
	// contains filtered or unexported fields
}

func (*Dataset) AddElement

func (d *Dataset) AddElement(e Element) error

func (*Dataset) GetAllElements

func (d *Dataset) GetAllElements() []ElementNoIndex

func (*Dataset) GetElement

func (d *Dataset) GetElement(name string) (Element, error)

func (*Dataset) GetID

func (d *Dataset) GetID() string

func (*Dataset) GetLength

func (d *Dataset) GetLength() int

func (*Dataset) ListElements

func (d *Dataset) ListElements() []ElementMeta

func (*Dataset) Save

func (d *Dataset) Save(ctx context.Context) error

type DatasetMeta

type DatasetMeta struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type Element

type Element struct {
	ElementMeta    `json:",inline"`
	Index          int    `json:"index,omitempty"`
	Contents       string `json:"contents,omitempty"`
	BinaryContents []byte `json:"binaryContents,omitempty"`
}

type ElementMeta

type ElementMeta struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type ElementNoIndex

type ElementNoIndex struct {
	ElementMeta    `json:",inline"`
	Contents       string `json:"contents,omitempty"`
	BinaryContents []byte `json:"binaryContents,omitempty"`
}

ElementNoIndex is used for returning data to the user, since the user does not care about the index.

type Manager

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

func NewManager

func NewManager(workspaceID string) (Manager, error)

func (*Manager) GetDataset

func (m *Manager) GetDataset(ctx context.Context, id string) (Dataset, error)

func (*Manager) ListDatasets

func (m *Manager) ListDatasets(ctx context.Context) ([]DatasetMeta, error)

func (*Manager) NewDataset

func (m *Manager) NewDataset(ctx context.Context, name, description string) (Dataset, error)

Jump to

Keyboard shortcuts

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