util

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool2Ptr

func Bool2Ptr(b bool) *bool

func EnsureDB

func EnsureDB(conn string) (bool, error)

func Int2Ptr

func Int2Ptr(i int) *int

func Ptr2Float

func Ptr2Float(val *float32) float32

Ptr2Float returns the value passed in if it isn't nil. Returns 0 otherwise.

func Ptr2Int

func Ptr2Int(i *int) int

func Ptr2Str

func Ptr2Str(p *string) string

func Ptr2Time

func Ptr2Time(t *time.Time) time.Time

func RunFlywayCmd

func RunFlywayCmd(conn, migrationsDir, flywayCommand string) error

RunFlywayCmd FlayWay command on by using th current,

func Str2Ptr

func Str2Ptr(p string) *string

func Str2Uint32

func Str2Uint32(str string) (uint32, error)

Types

type Cache added in v1.1.7

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

func NewCache added in v1.1.7

func NewCache(expiration time.Duration) Cache

func (*Cache) Get added in v1.1.7

func (c *Cache) Get(key string) (interface{}, bool)

Get retrieves the value associated with the key in case it exists and is not expired

func (*Cache) Set added in v1.1.7

func (c *Cache) Set(key string, value interface{})

Set stores the value associated with the key for the expiration.

Jump to

Keyboard shortcuts

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