sqlite

package
v0.0.0-...-0e9609f Latest Latest
Warning

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

Go to latest
Published: Nov 3, 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 coercion.Workstream and any use outside of that 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) Delete

func (d Vault) Delete(ctx context.Context, id uuid.UUID) error

Delete deletes a plan with "id" from the storage.

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