scalar

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigInt

type BigInt int64

BigInt wraps the scalar implementation for big integer, with string representation

@scalar BigInt string

func NewBigInt

func NewBigInt(value int64) BigInt

NewBigInt creates a BigInt instance

func (*BigInt) FromValue

func (bi *BigInt) FromValue(value any) error

FromValue decode any value to Int64.

func (BigInt) MarshalJSON

func (bi BigInt) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (BigInt) String

func (bi BigInt) String() string

Stringer implements fmt.Stringer interface.

func (*BigInt) UnmarshalJSON

func (bi *BigInt) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Bytes added in v0.5.3

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

Bytes wraps the scalar implementation for bytes with base64 encoding

@scalar Bytes string

func NewBytes added in v0.5.3

func NewBytes(data []byte) *Bytes

NewBytes create a Bytes instance

func ParseBytes added in v0.5.3

func ParseBytes(value string) (*Bytes, error)

ParseBytes parses bytes from base64 string

func (Bytes) Bytes added in v0.5.3

func (bs Bytes) Bytes() []byte

Bytes get the inner bytes value.

func (*Bytes) FromValue added in v0.5.3

func (bs *Bytes) FromValue(value any) error

FromValue decode any value to d Date.

func (Bytes) Len added in v0.5.3

func (bs Bytes) Len() int

Bytes get the inner bytes length.

func (Bytes) MarshalJSON added in v0.5.3

func (bs Bytes) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (Bytes) String added in v0.5.3

func (bs Bytes) String() string

String implements fmt.Stringer interface.

func (*Bytes) UnmarshalJSON added in v0.5.3

func (bs *Bytes) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Date

type Date struct {
	time.Time
}

Date wraps the scalar implementation for date representation string

@scalar Date date

func NewDate

func NewDate(year int, month time.Month, day int) *Date

NewDate creates a date instance

func ParseDate

func ParseDate(value string) (*Date, error)

ParseDate parses a date from string

func (*Date) FromValue

func (d *Date) FromValue(value any) error

FromValue decode any value to d Date.

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (Date) String

func (d Date) String() string

Stringer implements fmt.Stringer interface.

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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