types

package
v2.0.0-...-d0150a3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean bool

Boolean :

func (*Boolean) Scan

func (x *Boolean) Scan(src any) error

Scan :

type Key

type Key struct {
	Namespace string
	Kind      string
	IntID     int64
	NameID    string
	Parent    *Key
}

Key :

func DecodeKey

func DecodeKey(encoded string) (*Key, error)

DecodeKey decodes a key from the opaque representation returned by Encode.

func IDKey

func IDKey(kind string, id int64, parent *Key) *Key

IDKey creates a new key with an ID. The supplied kind cannot be empty. The supplied parent must either be a complete key or nil. The namespace of the new key is empty.

func NameKey

func NameKey(kind, name string, parent *Key) *Key

NameKey creates a new key with a name. The supplied kind cannot be empty. The supplied parent must either be a complete key or nil. The namespace of the new key is empty.

func NewIDKey

func NewIDKey(kind string, parent *Key) *Key

NewIDKey :

func NewNameKey

func NewNameKey(kind string, parent *Key) *Key

NewNameKey :

func ParseKey

func ParseKey(value string) (*Key, error)

ParseKey :

func (*Key) Clone

func (k *Key) Clone() *Key

Clone :

func (Key) ColumnDataType

func (k Key) ColumnDataType(ctx context.Context) *sqlx.Column

DataType :

func (Key) Encode

func (k Key) Encode() string

Encode returns an opaque representation of the key suitable for use in HTML and URLs. This is compatible with the Python and Java runtimes.

func (*Key) Equal

func (k *Key) Equal(o *Key) bool

Equal reports whether two keys are equal. Two keys are equal if they are both nil, or if their kinds, IDs, names, namespaces and parents are equal.

func (Key) GoString

func (k Key) GoString() string

GoString returns a string representation the raw string of key (without encoding).

func (*Key) GobDecode

func (k *Key) GobDecode(buf []byte) error

GobDecode unmarshals a sequence of bytes using an encoding/gob.Decoder.

func (Key) GobEncode

func (k Key) GobEncode() ([]byte, error)

GobEncode marshals the key into a sequence of bytes using an encoding/gob.Encoder.

func (*Key) ID

func (k *Key) ID() string

ID : is a safe method to retrieve `IntID` or `NameID` value

func (*Key) Incomplete

func (k *Key) Incomplete() bool

Incomplete : is a safe method to check key is nil or empty

func (*Key) IsZero

func (k *Key) IsZero() bool

valid returns whether the key is valid.

func (Key) MarshalBSONValue

func (k Key) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue :

func (Key) MarshalGQL

func (k Key) MarshalGQL(w io.Writer)

func (Key) MarshalJSON

func (k Key) MarshalJSON() ([]byte, error)

MarshalJSON :

func (Key) MarshalJSONB

func (k Key) MarshalJSONB() ([]byte, error)

MarshalJSONB :

func (Key) MarshalText

func (k Key) MarshalText() ([]byte, error)

MarshalText :

func (*Key) Root

func (k *Key) Root() *Key

Root :

func (*Key) Scan

func (k *Key) Scan(it any) error

Scan :

func (Key) String

func (k Key) String() string

String returns a string representation of the key.

func (*Key) UnmarshalBSONValue

func (k *Key) UnmarshalBSONValue(t bsontype.Type, b []byte) error

UnmarshalBSONValue :

func (*Key) UnmarshalGQL

func (k *Key) UnmarshalGQL(it any) error

func (*Key) UnmarshalJSON

func (k *Key) UnmarshalJSON(b []byte) error

UnmarshalJSON :

func (*Key) UnmarshalJSONB

func (k *Key) UnmarshalJSONB(b []byte) error

UnmarshalJSONB :

func (*Key) UnmarshalText

func (k *Key) UnmarshalText(b []byte) error

UnmarshalText :

func (Key) Value

func (k Key) Value() (driver.Value, error)

Value :

type Set

type Set[T setDataType] []T

Set : sql data type of `SET`

func (*Set[T]) ColumnDataType

func (s *Set[T]) ColumnDataType(ctx context.Context) *sql.Column

DataType :

func (*Set[T]) Scan

func (s *Set[T]) Scan(it any) error

Scan :

func (Set[T]) Value

func (s Set[T]) Value() (driver.Value, error)

Value :

Jump to

Keyboard shortcuts

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