util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PackageFormat_TARGZ = "tar.gz"
	PackageFormat_TAR   = "tar"
)

Variables

This section is empty.

Functions

func ExistString

func ExistString(strs []string, str string) bool

ExistString to find if exist string

func UnTar

func UnTar(source []byte, packageFormat string, target string) error

Types

type EndPointStatus

type EndPointStatus int
const (
	EndPointStatus_Valid EndPointStatus = iota
	EndPointStatus_Connectable
	EndPointStatus_Refused
	EndPointStatus_Timeout
	EndPointStatus_NotFound
)

func GetEndpointStatus

func GetEndpointStatus(address string) EndPointStatus

GetEndpointStatus to get status of the peer endpoint. The result must not be EndpointStatus_Valid, since that is determined by peer query, instead of this network method,

type Set

type Set []interface{}

Set an easy Set TODO performance TODO change interface{} key to string, for json.Marshal issue. Not routine safe

func NewSet

func NewSet(ks ...interface{}) Set

NewSet create a set

func NewStringSet

func NewStringSet(ks ...string) Set

NewStringSet create a set

func (*Set) Add

func (s *Set) Add(nv interface{})

Add add key

func (*Set) Exist

func (s *Set) Exist(nv interface{}) bool

Exist if nexist key

func (*Set) StringList

func (s *Set) StringList() []string

StringList get list as strings TODO performance

Jump to

Keyboard shortcuts

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