pkg

package
v0.0.0-...-334364b Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: Apache-2.0 Imports: 12 Imported by: 8

Documentation

Index

Constants

View Source
const (
	ProtocolHttp = Protocol("http")
	ProtocolUnix = Protocol("unix")
)
View Source
const (
	KC_RAND_KIND_NUM   = 0
	KC_RAND_KIND_LOWER = 1
	KC_RAND_KIND_UPPER = 2
	KC_RAND_KIND_ALL   = 3
)

Variables

This section is empty.

Functions

func CheckFileExist

func CheckFileExist(filepath string) (string, error)

func EndpointsToStrings

func EndpointsToStrings(endpoints map[string]Endpoint) []string

func GetCmdDir

func GetCmdDir() string

func GetDataDir

func GetDataDir() string

func GetLocalIP

func GetLocalIP() (got string)

Method 2 to get local IP addr

func GetRootDir

func GetRootDir() string

func IntranetIP

func IntranetIP() (ips []string, err error)

Method 1 to get local IP addr

func IsIntranet

func IsIntranet(ipStr string) bool

func KRand

func KRand(size int, kind int) []byte

func SetCmdDir

func SetCmdDir()

func SetDataDir

func SetDataDir(d string)

func SetRootDir

func SetRootDir()

func TrimAddrs

func TrimAddrs(addrs []string) []string

Types

type Endpoint

type Endpoint struct {
	Protocol Protocol
	IPAddr   string
	Port     Port
}

func ParseEndpoint

func ParseEndpoint(str string) (Endpoint, error)

func ParseEndpoints

func ParseEndpoints(slice []string) ([]Endpoint, error)

func (Endpoint) String

func (e Endpoint) String() string

type Event

type Event string

func (Event) None

func (e Event) None() bool

None event produced by a watcher timeout

type EventStream

type EventStream interface {
	Next(timeout time.Duration) chan Event
}

type Port

type Port int32

func (Port) Value

func (p Port) Value() int32

type Protocol

type Protocol string

func (Protocol) String

func (p Protocol) String() string

type StringSlice

type StringSlice []string

func NewStringSlice

func NewStringSlice(value string) StringSlice

func (StringSlice) String

func (f StringSlice) String() string

func (StringSlice) Value

func (f StringSlice) Value() []string

Jump to

Keyboard shortcuts

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