utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolI

func BoolI(input interface{}) *bool

func CheckErr

func CheckErr(err error)

func DateTimeNowInt

func DateTimeNowInt() string

func DirOrFileExists

func DirOrFileExists(path string) (bool, error)

func FileToBase64

func FileToBase64(path string) ([]byte, error)

func Float

func Float(input string) float64

func FloatFromJson

func FloatFromJson(input interface{}) float64

func FloatI

func FloatI(input interface{}) *float64

func FloatInterface

func FloatInterface(input interface{}) float64

func GetActualDays

func GetActualDays() ([]time.Time, error)

func GetActualStartEndDays

func GetActualStartEndDays(month int) (string, string)

func GetDaysByPeriod

func GetDaysByPeriod(beginDay string, endDay string) ([]time.Time, error)

func GetDaysFromMonth

func GetDaysFromMonth(year int, month time.Month) ([]string, error)

func GetDaysFromYearMonth

func GetDaysFromYearMonth(yearMonth string) ([]time.Time, error)

func GetDaysFromYearMonthInt

func GetDaysFromYearMonthInt(yearMonth int64) ([]time.Time, error)

func GetEnv

func GetEnv(key, fallback string) string

func GetWeekDayByYearMonth

func GetWeekDayByYearMonth(yearMonth int64) (map[int]time.Time, error)

func Int

func Int(input string) int

func Int64

func Int64(input string) int64

func Int64I

func Int64I(input interface{}) *int64

func IntI

func IntI(input interface{}) *int

func RecursiveZip

func RecursiveZip(outputZip, inputPath string) error

func SplitDbAndTable

func SplitDbAndTable(s string) (string, string)

func StringI

func StringI(input interface{}) *string

func Time

func Time(input string) time.Time

func TimeByTimeZone

func TimeByTimeZone(input, zone string) time.Time

func TimeI

func TimeI(input interface{}, layout string) *time.Time

func ToJsonBytes

func ToJsonBytes(input interface{}) []byte

func UniRequestId

func UniRequestId(inputToken string) uint64

Types

type Action

type Action struct {
	SOAPAction string
	Client     string
}
var Actions *Action

func (*Action) Request

func (act *Action) Request(input []byte) ([]byte, error)

func (*Action) RequestJson

func (act *Action) RequestJson(input []byte) ([]byte, error)

type FieldValidateErrorType

type FieldValidateErrorType struct {
	Field   string `json:"field" bson:"field,omitempty"`
	Code    int    `json:"code" bson:"code,omitempty"`
	Message string `json:"message" bson:"message,omitempty"`
}

type Timeout

type Timeout struct {
	IsTimeout bool `json:"id" bson:"_id"`
}

type VimbError

type VimbError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func (*VimbError) CheckTimeout

func (e *VimbError) CheckTimeout(method string) error

func (VimbError) Error

func (e VimbError) Error() string

type VimbResponse

type VimbResponse struct {
	FilePath string
}

func (*VimbResponse) Convert

func (req *VimbResponse) Convert(key string) (interface{}, error)

type YearMonth

type YearMonth struct {
	Month       time.Month `json:"month"`
	Year        int        `json:"year"`
	IntValue    int
	ValueString string
}

func GetActualMonths

func GetActualMonths() ([]YearMonth, error)

func GetPeriodFromYearMonths

func GetPeriodFromYearMonths(beginMonth string, endMonth string) ([]YearMonth, error)

Jump to

Keyboard shortcuts

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