utils

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: May 3, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillStruct added in v0.1.9

func FillStruct(s interface{}, m map[string]interface{}) error

func LoadNodeID added in v0.1.7

func LoadNodeID(filePath string) (string, error)

LoadNodeID load or create id in local id file

func NewError added in v0.1.7

func NewError(severity SwanErrorSeverity, err interface{}) error

func SetField added in v0.1.9

func SetField(obj interface{}, name string, value interface{}) error

func SliceContains

func SliceContains(slice []string, value string) bool

func SliceUnique

func SliceUnique(slice []string) bool

Types

type SortableNodePath added in v0.1.11

type SortableNodePath []string

example node path => /swan/leader-election/_c_c7b2927d40ec05db4d199a804437995c-node0000000023 sortable value is node0000000023

func (SortableNodePath) Len added in v0.1.11

func (a SortableNodePath) Len() int

func (SortableNodePath) Less added in v0.1.11

func (a SortableNodePath) Less(i, j int) bool

func (SortableNodePath) Swap added in v0.1.11

func (a SortableNodePath) Swap(i, j int)

type SwanError added in v0.1.7

type SwanError struct {
	Severity SwanErrorSeverity `json:"Severity"`
	Err      string            `json:"Err"`
}

func (*SwanError) Error added in v0.1.7

func (e *SwanError) Error() string

type SwanErrorSeverity added in v0.1.7

type SwanErrorSeverity int
const (
	SeverityLow SwanErrorSeverity = iota
	SeverityMiddle
	SeverityHigh
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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