specification

package
v0.0.0-...-75be81d Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryStorage

type BinaryStorage interface {
	Get(ctx context.Context, id string) ([]byte, error)
	GetAll(ctx context.Context) ([][]byte, error)
	Add(ctx context.Context, id string, data []byte) error
	Remove(ctx context.Context, id string) error
}

type Executable

type Executable struct {
	Type string
	Data map[string]any
}

type IO

type IO struct {
	Inputs  ResourceSet
	Outputs ResourceSet
}

type JsonStorage

type JsonStorage[T any] struct {
	Raw    BinaryStorage
	IdFunc func(T) string
}

func (*JsonStorage[T]) Add

func (storage *JsonStorage[T]) Add(ctx context.Context, item T) error

func (*JsonStorage[T]) Get

func (storage *JsonStorage[T]) Get(ctx context.Context, id string) (T, error)

func (*JsonStorage[T]) GetAll

func (storage *JsonStorage[T]) GetAll(ctx context.Context) ([]T, error)

func (*JsonStorage[T]) Remove

func (storage *JsonStorage[T]) Remove(ctx context.Context, id string) error

type Manager

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

func NewManager

func NewManager(specificationBinaryStorage, typeBinaryStorage BinaryStorage) *Manager

func (*Manager) Specifications

func (manager *Manager) Specifications() *JsonStorage[Specification]

func (*Manager) Types

func (manager *Manager) Types() *JsonStorage[TypeWithID]

type PostgresBinaryStorage

type PostgresBinaryStorage struct {
	DB    *pgxpool.Pool
	Table string
	// contains filtered or unexported fields
}

func (*PostgresBinaryStorage) Add

func (s *PostgresBinaryStorage) Add(ctx context.Context, id string, data []byte) error

func (*PostgresBinaryStorage) Get

func (s *PostgresBinaryStorage) Get(ctx context.Context, id string) ([]byte, error)

func (*PostgresBinaryStorage) GetAll

func (s *PostgresBinaryStorage) GetAll(ctx context.Context) ([][]byte, error)

func (*PostgresBinaryStorage) Remove

func (s *PostgresBinaryStorage) Remove(ctx context.Context, id string) error

type ResourceSet

type ResourceSet struct {
	Naming map[int]string
	Types  map[int]typing.Type
}

type Specification

type Specification struct {
	// ID is a path to specification, it's expected to be like /a/b/c/task.go
	ID         string
	IO         IO
	Executable Executable
	Meta       map[string]any
}

type TypeWithID

type TypeWithID struct {
	ID   string
	Type typing.Type
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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