util

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2017 License: GPL-3.0 Imports: 21 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(a interface{}, e interface{}) bool

func CopyField

func CopyField(toValue, fromValue interface{}, fieldNames ...string) (err error)

Copy field from a struct to another. if have fieldNames just copy this field, if not copy all same name field

func GenerateSlug

func GenerateSlug(str string) (slug string)

func GetBytes

func GetBytes(data interface{}) ([]byte, error)

func GetFieldKind

func GetFieldKind(obj interface{}, name string) reflect.Kind

func GetFieldValue

func GetFieldValue(obj interface{}, name string) interface{}

func GetInterface

func GetInterface(bts []byte, data interface{}) error

func GetTimeInterval added in v0.2.6

func GetTimeInterval(spec string) (duration time.Duration, err error)

func GetType

func GetType(obj interface{}) string

func GoroutineID added in v0.2.6

func GoroutineID() int

func Indirect

func Indirect(reflectValue reflect.Value) reflect.Value

func IndirectType

func IndirectType(reflectType reflect.Type) reflect.Type

func Intersect

func Intersect(a, b []string) []string

func JsonToPb

func JsonToPb(b []byte, obj interface{}) error

func PbToJSON

func PbToJSON(obj interface{}) ([]byte, error)

func RegexpGetParams

func RegexpGetParams(regEx, url string) (paramsMap map[string]string)

*

  • Parses url with the given regular expression and returns the
  • group values defined in the expression. *

func RegexpMatch

func RegexpMatch(regEx, url string) bool

func VerifyJob

func VerifyJob(job *pb.Job) error

Types

type FanOutQueue

type FanOutQueue struct {
	// contains filtered or unexported fields
}

func (*FanOutQueue) FanOut

func (f *FanOutQueue) FanOut()

func (*FanOutQueue) Sub

func (f *FanOutQueue) Sub() chan struct{}

Jump to

Keyboard shortcuts

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