Documentation ¶
Index ¶
- func CheckUnitBody(path, source string, env map[string]interface{}) (err error)
- func CheckUnitHashes(names []string, states map[string]uint64) (err error)
- func CreateUnit(path, source string, env map[string]interface{}) (err error)
- func DestroyUnits(patterns ...string) (err error)
- func GetLocalIP(t *testing.T) string
- func RandomPort(t *testing.T) int
- func RandomPorts(t *testing.T, count int) (res []int)
- func TestName(t *testing.T) (res string)
- func UnitStatesFn(patterns []string, expect map[string]string) func() error
- func WaitNoError(config WaitConfig, fn func() error) (err error)
- func WaitNoError10(fn func() error) (err error)
- func WaitNoErrorT(t *testing.T, config WaitConfig, fn func() error)
- func WaitNoErrorT10(t *testing.T, fn func() error)
- func WriteTemplate(w io.Writer, source string, env map[string]interface{}) (err error)
- type ConsulServer
- type ConsulServerConfig
- type WaitConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckUnitBody ¶
CheckUnitBody compares file contents with template
func CreateUnit ¶
CreateUnit creates unit with given body template
func DestroyUnits ¶
DestroyUnits disables and destroys units with given patterns
func GetLocalIP ¶
func RandomPort ¶
func UnitStatesFn ¶
UnitStatesFn returns function to check all states for units founded by patterns. Expect should be "unit.service":"systemd-state"
func WaitNoError ¶
func WaitNoError(config WaitConfig, fn func() error) (err error)
func WaitNoError10 ¶
func WaitNoErrorT ¶
func WaitNoErrorT(t *testing.T, config WaitConfig, fn func() error)
Poll while provided fn return no error
func WaitNoErrorT10 ¶
Types ¶
type ConsulServer ¶
type ConsulServer struct { Config *ConsulServerConfig // contains filtered or unexported fields }
func NewConsulServer ¶
func NewConsulServer(t *testing.T, configFn func(config *ConsulServerConfig)) (s *ConsulServer)
func (*ConsulServer) Address ¶
func (s *ConsulServer) Address() (res string)
func (*ConsulServer) Clean ¶
func (s *ConsulServer) Clean()
func (*ConsulServer) Down ¶
func (s *ConsulServer) Down()
func (*ConsulServer) Pause ¶
func (s *ConsulServer) Pause()
func (*ConsulServer) Unpause ¶
func (s *ConsulServer) Unpause()
func (*ConsulServer) Up ¶
func (s *ConsulServer) Up()
func (*ConsulServer) WaitAlive ¶
func (s *ConsulServer) WaitAlive()
func (*ConsulServer) WaitLeader ¶
func (s *ConsulServer) WaitLeader()
type ConsulServerConfig ¶
type ConsulServerConfig struct { RepoTag string `json:"-"` NodeName string `json:"node_name"` NodeID string `json:"node_id"` AdvertiseAddr string `json:"advertise_addr"` ClientAddr string `json:"client_addr"` Bootstrap bool `json:"bootstrap"` Server bool `json:"server"` UI bool `json:"ui"` Performance struct { RaftMultiplier int `json:"raft_multiplier"` } `json:"performance"` SessionTTLMin string `json:"session_ttl_min"` Ports struct { HTTP int } }
type WaitConfig ¶
func DefaultWaitConfig ¶
func DefaultWaitConfig() (c WaitConfig)
Click to show internal directories.
Click to hide internal directories.