util

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHttpMethod

func CheckHttpMethod(method string) bool

func DailyStringToTime

func DailyStringToTime(s string) time.Time

func GetModulePath

func GetModulePath() string

func HourlyStringToTime

func HourlyStringToTime(s string) time.Time

func MapToStructPB

func MapToStructPB(m map[string]interface{}) (*structpb.Struct, error)

func MonthlyStringToTime

func MonthlyStringToTime(s string) time.Time

func ObjectToStructPB

func ObjectToStructPB(o interface{}) (*structpb.Struct, error)

func ParseURL added in v0.3.15

func ParseURL(s string) (schema, host, port, path, query, fragment string, err error)

func SplitStringByN

func SplitStringByN(s string, n int) (split []string)

func StringInSlice

func StringInSlice(str string, list []string) bool

func StringToTime

func StringToTime(s string) time.Time

func StructPBToMap

func StructPBToMap(s *structpb.Struct) (map[string]interface{}, error)

func TimeToDailyStringFormat

func TimeToDailyStringFormat(t time.Time) string

func TimeToHourlyStringFormat

func TimeToHourlyStringFormat(t time.Time) string

func TimeToMonthlyStringFormat

func TimeToMonthlyStringFormat(t time.Time) string

func TimeToString

func TimeToString(t time.Time) string

func TimeToYearlyStringFormat

func TimeToYearlyStringFormat(t time.Time) string

func TimestampByMaxTime

func TimestampByMaxTime() int64

func ValuePBToInterface

func ValuePBToInterface(v *structpb.Value) interface{}

func YearlyStringToTime

func YearlyStringToTime(s string) time.Time

Types

type Backoff

type Backoff struct {
	NowFunc func() time.Time
	// contains filtered or unexported fields
}

func NewBackoff

func NewBackoff(resetAfter time.Duration) *Backoff

func (*Backoff) Success

func (b *Backoff) Success()

func (*Backoff) Wait

func (b *Backoff) Wait() time.Duration

Jump to

Keyboard shortcuts

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