ccc

package module
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 6 Imported by: 10

README

ccc

Utility types and functions created and maintained by the CCC team.

Documentation

Overview

package ccc contains utility types and functions

Index

Constants

This section is empty.

Variables

View Source
var NilUUID = UUID{}

Functions

func Must added in v0.2.1

func Must[T any](value T, err error) T

Must is a helper function to avoid the need to check for errors.

func Ptr

func Ptr[T any](t T) *T

Types

type Duration added in v0.2.8

type Duration struct {
	time.Duration
}

func NewDuration added in v0.2.9

func NewDuration(d time.Duration) Duration

func NewDurationFromString added in v0.2.9

func NewDurationFromString(s string) (Duration, error)

func (*Duration) DecodeSpanner added in v0.2.8

func (d *Duration) DecodeSpanner(val any) error

func (Duration) EncodeSpanner added in v0.2.8

func (d Duration) EncodeSpanner() (any, error)

func (Duration) MarshalJSON added in v0.2.8

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

MarshalJSON implements json.Marshaler.MarshalJSON for Duration.

func (Duration) MarshalText added in v0.2.8

func (d Duration) MarshalText() ([]byte, error)

func (*Duration) UnmarshalJSON added in v0.2.8

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

UnmarshalJSON implements json.Unmarshaler.UnmarshalJSON for Duration.

func (*Duration) UnmarshalText added in v0.2.8

func (d *Duration) UnmarshalText(text []byte) error

type JSONMap

type JSONMap map[string]any

func (*JSONMap) UnmarshalJSON

func (jM *JSONMap) UnmarshalJSON(b []byte) error

type NullDuration added in v0.2.9

type NullDuration struct {
	Duration
	Valid bool
}

func NewNullDuration added in v0.2.9

func NewNullDuration(d time.Duration) NullDuration

func NewNullDurationFromString added in v0.2.9

func NewNullDurationFromString(s string) (NullDuration, error)

func (*NullDuration) DecodeSpanner added in v0.2.9

func (d *NullDuration) DecodeSpanner(val any) error

func (NullDuration) EncodeSpanner added in v0.2.9

func (d NullDuration) EncodeSpanner() (any, error)

func (NullDuration) MarshalJSON added in v0.2.9

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

MarshalJSON implements json.Marshaler.MarshalJSON for Duration.

func (NullDuration) MarshalText added in v0.2.9

func (d NullDuration) MarshalText() ([]byte, error)

func (*NullDuration) UnmarshalJSON added in v0.2.9

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

UnmarshalJSON implements json.Unmarshaler.UnmarshalJSON for Duration.

func (*NullDuration) UnmarshalText added in v0.2.9

func (d *NullDuration) UnmarshalText(text []byte) error

type NullUUID

type NullUUID struct {
	UUID
	Valid bool
}

func NewNullUUID

func NewNullUUID() (NullUUID, error)

func NullUUIDFromString

func NullUUIDFromString(s string) (NullUUID, error)

func NullUUIDFromUUID

func NullUUIDFromUUID(u UUID) NullUUID

func (*NullUUID) DecodeSpanner

func (u *NullUUID) DecodeSpanner(val any) error

func (NullUUID) EncodeSpanner

func (u NullUUID) EncodeSpanner() (any, error)

func (NullUUID) IsNil

func (u NullUUID) IsNil() bool

IsNil implements NullableValue.IsNil for NullUUID.

func (NullUUID) MarshalJSON added in v0.2.3

func (u NullUUID) MarshalJSON() ([]byte, error)

func (NullUUID) MarshalText added in v0.2.3

func (u NullUUID) MarshalText() ([]byte, error)

func (*NullUUID) UnmarshalJSON added in v0.2.3

func (u *NullUUID) UnmarshalJSON(data []byte) error

func (*NullUUID) UnmarshalText

func (u *NullUUID) UnmarshalText(text []byte) error

type UUID

type UUID struct {
	uuid.UUID
}

func NewUUID

func NewUUID() (UUID, error)

func UUIDFromString

func UUIDFromString(s string) (UUID, error)

func (*UUID) DecodeSpanner

func (u *UUID) DecodeSpanner(val any) error

func (UUID) EncodeSpanner

func (u UUID) EncodeSpanner() (any, error)

func (UUID) MarshalJSON added in v0.2.3

func (u UUID) MarshalJSON() ([]byte, error)

func (UUID) MarshalText added in v0.2.3

func (u UUID) MarshalText() ([]byte, error)

func (*UUID) UnmarshalJSON added in v0.2.3

func (u *UUID) UnmarshalJSON(data []byte) error

func (*UUID) UnmarshalText

func (u *UUID) UnmarshalText(text []byte) error

Directories

Path Synopsis
accesstypes module
ccclint module
columnset module
lint module
linters
otelspanname Module
patchset module
pkg module
resource module
resourceset module
sns module

Jump to

Keyboard shortcuts

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