fsomain

package
v0.0.0-...-4450389 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package `fsomain` implements an event-sourced aggregate that contains the FSO filesystem observer main root entity. The main root is accessed via a wellknown name, usually `main`. To get to a repo, traverse entities:

fsomain -> fsoregistry -> fsorepos

The main root contains a list of registries. Registry details are in separate entities, implemented by package `fsoregistry`. Registries contain lists of repos. Repo details are in separate entities, implemented by package `fsorepos`.

Index

Constants

This section is empty.

Variables

View Source
var ErrCommandUnknown = errors.New("unknown command")
View Source
var ErrDomainNameInUse = errors.New("domain name already in used")
View Source
var ErrMalformedDomainName = errors.New("malformed unix domain name")
View Source
var ErrUninitialized = errors.New("uninitialized")
View Source
var NoVC = events.NoVC

`NoVC` is a sentinel value that can be passed in place of `vid` to indicate that concurrency version checks are skipped.

Functions

This section is empty.

Types

type Advancer

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

func (*Advancer) Advance

func (a *Advancer) Advance(s events.State, ev events.Event) events.State

type Behavior

type Behavior struct{}

func (Behavior) NewAdvancer

func (Behavior) NewAdvancer() events.Advancer

func (Behavior) NewEvent

func (Behavior) NewEvent() events.Event

func (Behavior) NewState

func (Behavior) NewState(id uuid.I) events.State

func (Behavior) Tell

func (Behavior) Tell(
	s events.State, c events.Command,
) ([]events.Event, error)

type CmdAddUnixDomain

type CmdAddUnixDomain struct {
	DomainId   uuid.I
	DomainName string
}

func (*CmdAddUnixDomain) AggregateCommand

func (*CmdAddUnixDomain) AggregateCommand()

type CmdConfirmRegistry

type CmdConfirmRegistry struct {
	Name string
}

func (*CmdConfirmRegistry) AggregateCommand

func (*CmdConfirmRegistry) AggregateCommand()

type CmdInitMain

type CmdInitMain struct {
	Name string
}

func (*CmdInitMain) AggregateCommand

func (*CmdInitMain) AggregateCommand()

type CmdInitRegistry

type CmdInitRegistry struct {
	Name string
}

func (*CmdInitRegistry) AggregateCommand

func (*CmdInitRegistry) AggregateCommand()

type Event

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

func (*Event) Id

func (e *Event) Id() ulid.I

func (*Event) MarshalProto

func (e *Event) MarshalProto() ([]byte, error)

func (*Event) Parent

func (e *Event) Parent() ulid.I

func (*Event) PbMainEvent

func (e *Event) PbMainEvent() *pb.Event

func (*Event) UnmarshalProto

func (e *Event) UnmarshalProto(data []byte) error

func (Event) WithId

func (e Event) WithId(id ulid.I) events.Event

Receiver by value.

func (Event) WithParent

func (e Event) WithParent(parent ulid.I) events.Event

Receiver by value.

type Main

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

func New

func New(mainJ *events.Journal) *Main

func (*Main) AddUnixDomain

func (r *Main) AddUnixDomain(
	id uuid.I, vid ulid.I, domainId uuid.I, domainName string,
) (ulid.I, error)

func (*Main) ConfirmRegistry

func (r *Main) ConfirmRegistry(
	id uuid.I, vid ulid.I, name string,
) (ulid.I, error)

func (*Main) FindId

func (r *Main) FindId(id uuid.I) (*State, error)

func (*Main) Init

func (r *Main) Init(
	id uuid.I, name string,
) (ulid.I, error)

func (*Main) InitRegistry

func (r *Main) InitRegistry(
	id uuid.I, vid ulid.I, name string,
) (ulid.I, error)

type RegistryInfo

type RegistryInfo struct {
	Name      string
	Confirmed bool
}

type State

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

func (*State) AggregateState

func (*State) AggregateState()

func (*State) FindUnixDomainName

func (st *State) FindUnixDomainName(name string) *UnixDomainInfo

func (*State) Id

func (s *State) Id() uuid.I

func (*State) NumRegistries

func (s *State) NumRegistries() int

func (*State) Registries

func (s *State) Registries() []RegistryInfo

func (*State) SetVid

func (s *State) SetVid(vid ulid.I)

func (*State) Vid

func (s *State) Vid() ulid.I

type UnixDomainInfo

type UnixDomainInfo struct {
	Id   uuid.I
	Name string
}

Jump to

Keyboard shortcuts

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