mod

package
v0.0.0-...-2eec6a9 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StageProposed = "proposed"
	StageApproved = "approved"
)

spec stages

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model manages files of cluster master

func Current

func Current() (*Model, error)

Current load model from current working dir

func Load

func Load(dir string) (*Model, error)

Load load a existed model from dir

func New

func New(dir string, replicas int) (*Model, error)

New create a new model instance

func (*Model) AddNode

func (m *Model) AddNode(node draft.Node) error

AddNode add node into draft

func (*Model) AlterNode

func (m *Model) AlterNode(atIndex int, node draft.Node) error

func (*Model) BuildSpec

func (m *Model) BuildSpec() (*spec.Spec, error)

func (*Model) Draft

func (m *Model) Draft() *draft.Draft

Draft returns draft of cluster

func (*Model) GetNode

func (m *Model) GetNode(index int) (*draft.Node, error)

GetNode get draft node by index

func (*Model) Identity

func (m *Model) Identity() *crypto.Identity

Identity returns identity of cluster master

func (*Model) LoadSpec

func (m *Model) LoadSpec(stage string) (*spec.OptSpec, error)

func (*Model) RemoveNode

func (m *Model) RemoveNode(index int) error

func (*Model) Save

func (m *Model) Save() error

Save save model state into files

func (*Model) SaveSpec

func (m *Model) SaveSpec(stage string, s spec.Spec) error

Jump to

Keyboard shortcuts

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