util

package
v0.0.0-...-f9dc819 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ProviderSet contains all provider from util package
	ProviderSet wire.ProviderSet = wire.NewSet(
		ProvideSnowflake,
	)
)

Functions

func BirthdayFromStr

func BirthdayFromStr(str string) (time.Time, error)

BirthdayFromStr parses string to time.Time using birthdayTimeLayout

func BirthdayFromTime

func BirthdayFromTime(t time.Time) string

BirthdayFromTime parses time to string using birthdayTimeLayout

func ProvideSnowflake

func ProvideSnowflake() *snowflake.Node

ProvideSnowflake produces *snowflake.Node

func WrapErrorWithMsg

func WrapErrorWithMsg(err error, msg string) error

WrapErrorWithMsg creates *Error by wrapping error with a custom message

Types

type Error

type Error struct {
	Err      error
	FileLine string
	FuncName string
	Message  string
}

Error is a custom error

func NewErrorFromMsg

func NewErrorFromMsg(msg string) *Error

NewErrorFromMsg creates *Error from string

func WrapError

func WrapError(err error) *Error

WrapError creates *Error by wrapping error

func (*Error) Error

func (e *Error) Error() string

Error returns error message

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns internal error

Jump to

Keyboard shortcuts

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