utils

package
v0.0.0-...-d23ef4a Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CovertToSchemeAddress

func CovertToSchemeAddress(addr net.Addr) string

func HasElem

func HasElem(s interface{}, elem interface{}) bool

func JoinPath

func JoinPath(absolutePath, relativePath string) string

func LastChar

func LastChar(str string) uint8

func ParseSchemeAddress

func ParseSchemeAddress(addr string) net.Addr

func Split2

func Split2(s, sep string) (string, string, bool)

func StringName

func StringName(i uint32, names []IntName, goSyntaxPre string, goSyntax bool) string

Types

type CompareResult

type CompareResult int32
const (
	Same CompareResult = iota
	GT
	LT
)

type DetailCompareResult

type DetailCompareResult int32
const (
	NoDifferent                     = 0
	MajorLT     DetailCompareResult = 1 << iota
	MajorGT
	MinorLT
	MinorGT
	PatchLT
	PatchGT
	PreReleaseLT
	PreReleaseGT
	BuildLT
	BuildGT
)

type IntName

type IntName struct {
	I uint32
	S string
}

type SemanticVersion

type SemanticVersion struct {
	Major      uint32
	Minor      uint32
	Patch      uint32
	PreRelease []string
	Build      []string
	// contains filtered or unexported fields
}

func NewSemVerFromString

func NewSemVerFromString(ver string) (semVer *SemanticVersion, err error)

func SemanticVersionMust

func SemanticVersionMust(semVer *SemanticVersion, err error) *SemanticVersion

func (*SemanticVersion) Compare

func (semVer *SemanticVersion) Compare(other *SemanticVersion) CompareResult

func (*SemanticVersion) Compatible

func (semVer *SemanticVersion) Compatible(other *SemanticVersion) bool

func (*SemanticVersion) DetailCompare

func (semVer *SemanticVersion) DetailCompare(other *SemanticVersion) DetailCompareResult

func (SemanticVersion) MarshalJSON

func (ver SemanticVersion) MarshalJSON() ([]byte, error)

func (*SemanticVersion) Scan

func (ver *SemanticVersion) Scan(value interface{}) (err error)

func (*SemanticVersion) String

func (semVer *SemanticVersion) String() string

func (*SemanticVersion) UnmarshalJSON

func (ver *SemanticVersion) UnmarshalJSON(b []byte) error

func (SemanticVersion) Value

func (ver SemanticVersion) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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