sqlite

package
v0.0.0-...-4521c63 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package sqlite provides a sqlite-based storage implementation for workflow.Plan data. This is used to implement the storage.ReadWriter interface.

This package is for use only by the workstream package and any use outside of workstream is not supported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Vault) error

Option is an option for configuring a ReadWriter.

func WithInMemory

func WithInMemory() Option

WithInMemory creates an in-memory storage.

type Vault

type Vault struct {
	private.Storage
	// contains filtered or unexported fields
}

Vault implements the storage.Vault interface.

func New

func New(ctx context.Context, root string, reg *registry.Register, options ...Option) (*Vault, error)

New is the constructor for *ReadWriter. root is the root path for the storage. If the root path does not exist, it will be created.

func (*Vault) Close

func (c *Vault) Close(ctx context.Context) error

func (Vault) Create

func (u Vault) Create(ctx context.Context, plan *workflow.Plan) error

Create writes Plan data to storage, and all underlying data.

func (Vault) Exists

func (r Vault) Exists(ctx context.Context, id uuid.UUID) (bool, error)

Exists returns true if the Plan ID exists in the storage.

func (Vault) List

func (r Vault) List(ctx context.Context, limit int) (chan storage.Stream[storage.ListResult], error)

List returns a list of Plan IDs in the storage in order from newest to oldest. This should return with most recent submiited first. Limit sets the maximum number of entrie to return

func (Vault) Read

func (r Vault) Read(ctx context.Context, id uuid.UUID) (*workflow.Plan, error)

ReadPlan returns a Plan from the storage.

func (Vault) Search

func (r Vault) Search(ctx context.Context, filters storage.Filters) (chan storage.Stream[storage.ListResult], error)

SearchPlans returns a list of Plan IDs that match the filter.

Directories

Path Synopsis
testing

Jump to

Keyboard shortcuts

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