refmap

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataStable uint8 = iota
	DataFlagged
	DataUpdated
	DataAdded
	DataRemove
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangedOp

type ChangedOp struct {
	Refs chan *RefLink
}

type Config

type Config interface {
	Error(...error) error
	Destination(...string) string
	Source(...string) string
	Force(...bool) bool
	Watching() bool
	RegisterCmd(string, []string, []string, ...uint)
}

type ExecOp

type ExecOp struct {
	Key     string
	Op      string
	Cmd     []string
	Deps    []string
	Timeout uint
	Rsp     chan ExecRsp
}

type ExecRsp

type ExecRsp struct {
	Key            string
	StdOut, StdErr string
	Err            error
}

type ReadOp

type ReadOp struct {
	Src string
	Rsp chan *RefLink
}
type RefLink struct {
	Files  map[string]RefVal
	Change uint8
}
func NewRefLink() *RefLink

type RefMap

type RefMap struct {
	Reads  chan *ReadOp
	Writes chan *WriteOp
	Sets   chan *SetOp

	Changed chan *ChangedOp
	Exec    chan *ExecOp
	// contains filtered or unexported fields
}

func NewRefMap

func NewRefMap() *RefMap

func (RefMap) Assess

func (r RefMap) Assess()

func (RefMap) ChangedRefs

func (r RefMap) ChangedRefs() (refs []*RefLink)

func (RefMap) ChangedRefsChan added in v1.0.6

func (r RefMap) ChangedRefsChan() chan *RefLink

func (RefMap) Execute

func (r RefMap) Execute() []ExecRsp

func (RefMap) Finish

func (r RefMap) Finish()

func (RefMap) Read

func (r RefMap) Read(src string) *RefLink

func (RefMap) Register

func (r RefMap) Register(key string, cmd, deps []string, timeoutOpt ...uint)

func (RefMap) Set

func (r RefMap) Set(key, val string) error

func (*RefMap) Start

func (m *RefMap) Start()

func (RefMap) Sync

func (r RefMap) Sync(mon *utils.Monitor) error

func (RefMap) Write

func (r RefMap) Write(src, dst string, val RefVal)

type RefVal

type RefVal interface {
	Build(Config)
	Change(...uint8) uint8
	Hash() string
}

type SetOp

type SetOp struct {
	Key string
	Val string
	Err chan error
}

type SyncOp

type SyncOp struct {
	Mon *utils.Monitor
	Err chan error
}

type WriteOp

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

Jump to

Keyboard shortcuts

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