state

package
v0.0.0-...-7d81075 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2016 License: MPL-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Timeout      = errors.New("Timeout")
	NotSupported = errors.New("not supported")
)

Functions

This section is empty.

Types

type BounceBool

type BounceBool struct {
	Address string
	Method  string
	Timeout time.Duration
	In      bool
}

type BounceNil

type BounceNil struct {
	Address string
	Method  string
	Timeout time.Duration
	In      Nil
}

type BounceString

type BounceString struct {
	Address string
	Method  string
	Timeout time.Duration
	In      string
}

type Bouncer

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

func (Bouncer) Bounce

func (bounce Bouncer) Bounce(location string) State

func (Bouncer) GetDBRole

func (bounce Bouncer) GetDBRole() (string, error)

func (Bouncer) GetDataDir

func (bounce Bouncer) GetDataDir() (string, error)

func (Bouncer) GetRole

func (bounce Bouncer) GetRole() (string, error)

func (Bouncer) HasSynced

func (bounce Bouncer) HasSynced() (bool, error)

func (Bouncer) Location

func (bounce Bouncer) Location() string

func (Bouncer) Ready

func (bounce Bouncer) Ready()

func (Bouncer) SetDBRole

func (bounce Bouncer) SetDBRole(role string) error

func (Bouncer) SetSynced

func (bounce Bouncer) SetSynced(synced bool) error

type LocalState

type LocalState interface {
	State
	ExposeRPCEndpoint(string, string) (io.Closer, error)
}

func NewLocalState

func NewLocalState(role, location, dataDir string, store Store) (LocalState, error)

Creates and returns a state that represents a state on the local machine.

type Nil

type Nil struct{}

type State

type State interface {
	Ready()
	GetDataDir() (string, error)
	GetRole() (string, error)
	GetDBRole() (string, error)
	SetDBRole(string) error
	HasSynced() (bool, error)
	SetSynced(bool) error
	Location() string
	Bounce(location string) State
}

func NewRemoteState

func NewRemoteState(network, location string, timeout time.Duration) State

Creates and returns a State that represents a state reachable over an rpc connection

type StateRPC

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

func (*StateRPC) BounceBool

func (wrap *StateRPC) BounceBool(bounce BounceBool, reply *bool) error

func (*StateRPC) BounceNil

func (wrap *StateRPC) BounceNil(bounce BounceNil, reply *Nil) error

func (*StateRPC) BounceString

func (wrap *StateRPC) BounceString(bounce BounceString, reply *string) error

func (*StateRPC) GetDBRole

func (wrap *StateRPC) GetDBRole(arg string, reply *string) error

func (*StateRPC) GetDataDir

func (wrap *StateRPC) GetDataDir(arg string, reply *string) error

func (*StateRPC) GetRole

func (wrap *StateRPC) GetRole(arg string, reply *string) error

func (*StateRPC) HasSynced

func (wrap *StateRPC) HasSynced(arg bool, reply *bool) error

func (*StateRPC) Ready

func (wrap *StateRPC) Ready(a Nil, b *Nil) error

func (*StateRPC) SetSynced

func (wrap *StateRPC) SetSynced(sync bool, out *bool) error

type Store

type Store interface {
	Read(string, string, interface{}) error
	Write(string, string, interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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