branches

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExists   = errors.New("branch already exists")
	ErrNotFound = errors.New("branch not found")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Ts     nano.Ts     `zed:"ts"`
	Name   string      `zed:"name"`
	Commit ksuid.KSUID `zed:"commit"`
}

func NewConfig

func NewConfig(name string, commit ksuid.KSUID) *Config

func (*Config) Key

func (c *Config) Key() string

type Store

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

func CreateStore

func CreateStore(ctx context.Context, engine storage.Engine, logger *zap.Logger, path *storage.URI) (*Store, error)

func OpenStore

func OpenStore(ctx context.Context, engine storage.Engine, logger *zap.Logger, path *storage.URI) (*Store, error)

func (*Store) Add

func (s *Store) Add(ctx context.Context, config *Config) error

func (*Store) All

func (s *Store) All(ctx context.Context) ([]Config, error)

func (*Store) LookupByName

func (s *Store) LookupByName(ctx context.Context, name string) (*Config, error)

func (*Store) Remove

func (s *Store) Remove(ctx context.Context, config Config) error

Remove deletes a branch from the configuration journal. We make sure the last commit is the same as the reference config; otherwise, there was a race and someone did something with this branch in the meantime so we abort.

func (*Store) Update

func (s *Store) Update(ctx context.Context, config *Config, c journal.Constraint) error

Jump to

Keyboard shortcuts

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