types

package
v0.0.34 Latest Latest
Warning

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

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

README

Introduction

There are a set of customized types for json.Unmarshal or sql Scan uses, and these types can be used to instead of using basic types

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKey = uerror.New(100, "invalid key")
)

Functions

func Decrypt

func Decrypt(d, k []byte) ([]byte, error)

Types

type Duration

type Duration struct {
	time.Duration
}

Duration can be used for "ns", "us" (or "µs"), "ms", "s", "m", "h" suffixs

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

UnmarshalJSON for implementing the Unmarshaler interface

type EData

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

EData for encrypted data

func NewEData

func NewEData(s, k string) EData

NewEData the constructor

func (*EData) Scan

func (e *EData) Scan(src interface{}) error

Scan for implementing the sql.Scanner interface

func (EData) String

func (e EData) String() string

func (EData) Value

func (e EData) Value() (driver.Value, error)

Value for implementing the driver.Valuer interface

type Timestamp added in v0.0.2

type Timestamp struct {
	time.Time
}

func (Timestamp) MarshalJSON added in v0.0.2

func (t Timestamp) MarshalJSON() ([]byte, error)

func (*Timestamp) Scan added in v0.0.2

func (t *Timestamp) Scan(src interface{}) error

func (*Timestamp) UnmarshalJSON added in v0.0.16

func (t *Timestamp) UnmarshalJSON(data []byte) error

func (Timestamp) Value added in v0.0.2

func (t Timestamp) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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