pkg

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dog

type Dog struct {
	Name string
	Tag  Maybe[string]
}

func (*Dog) SetFromSchemaDog

func (d *Dog) SetFromSchemaDog(s DogSchema) error

func (Dog) ToSchemaDog

func (d Dog) ToSchemaDog() DogSchema

type Dog2

type Dog2 struct {
	Name    Maybe[string]
	PetType string
	Tag     Maybe[string]
}

func (*Dog2) SetFromSchemaDog2

func (d *Dog2) SetFromSchemaDog2(s DogSchema2) error

func (Dog2) ToSchemaDog2

func (d Dog2) ToSchemaDog2() DogSchema2

type DogSchema

type DogSchema struct {
	Name string
	Tag  Maybe[string]
}

type DogSchema2

type DogSchema2 struct {
	Name    Maybe[string]
	PetType string
	Tag     Maybe[string]
}

type Maybe

type Maybe[T any] struct {
	IsSet bool
	Value T
}

func Just

func Just[T any](v T) Maybe[T]

func Nothing

func Nothing[T any]() Maybe[T]

func (Maybe[T]) Get

func (m Maybe[T]) Get() (zero T, _ bool)

func (*Maybe[T]) Set

func (m *Maybe[T]) Set(v T)

type Nullable

type Nullable[T any] struct {
	IsSet bool
	Value T
}

func Null

func Null[T any]() Nullable[T]

func Pointer

func Pointer[T any](v T) Nullable[T]

func (Nullable[T]) Get

func (m Nullable[T]) Get() (zero T, _ bool)

func (*Nullable[T]) Set

func (m *Nullable[T]) Set(v T)

Jump to

Keyboard shortcuts

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