mdl

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const NamedView = "named"

Variables

This section is empty.

Functions

func Box

func Box[T any](v T) *T

func Empty

func Empty[T any]() (out T)

func EmptyIfNil

func EmptyIfNil[T any](v *T) T

func IsNil

func IsNil(m any) bool

func IsNilOrEmpty

func IsNilOrEmpty[T comparable](in *T) bool

func NamedOutput

func NamedOutput(in interface{}) interface{}

func NilIfEmpty

func NilIfEmpty[T comparable](in T) *T

func Unbox

func Unbox[T any](v *T, def T) T

func UnboxWith

func UnboxWith[T any](v *T, mkDef func() T) T

func UuidWithDashes

func UuidWithDashes(uuid *string) (*string, error)

Types

type ConfigProvider

type ConfigProvider interface {
	GetString(key string, optionalDefault ...string) string
}

type Identifiable

type Identifiable interface {
	GetId() *uint
}

type Identifier

type Identifier struct {
	Id *uint `json:"id" binding:"required"`
}

func WithIdentifier

func WithIdentifier(id *uint) *Identifier

func (*Identifier) GetId

func (i *Identifier) GetId() *uint

type Keyed

type Keyed interface {
	GetKey() string
}

type ModelId

type ModelId struct {
	Project     string `cfg:"project" default:"{app_project}"`
	Environment string `cfg:"environment" default:"{env}"`
	Family      string `cfg:"family" default:"{app_family}"`
	Group       string `cfg:"group" default:"{app_group}"`
	Application string `cfg:"application" default:"{app_name}"`
	Name        string `cfg:"name"`
}

func ModelIdFromString

func ModelIdFromString(str string) (ModelId, error)

func (*ModelId) PadFromConfig

func (m *ModelId) PadFromConfig(config ConfigProvider)

func (*ModelId) String

func (m *ModelId) String() string

type Nameable

type Nameable interface {
	Identifiable
	GetName() *string
}

type NamedOutputV0

type NamedOutputV0 struct {
	Id   *uint   `json:"id"`
	Name *string `json:"name"`
}

type Resource

type Resource interface {
	GetResourceName() string
}

type ResourceContextAware

type ResourceContextAware interface {
	GetResourceContext() map[string]interface{}
}

type Transformer

type Transformer func(in interface{}) (out interface{})

type TransformerMap

type TransformerMap map[string]map[int]Transformer

type TransformerResolver

type TransformerResolver func(view string, version int, in interface{}) (out interface{})

func Transform

func Transform(transformers TransformerMap) TransformerResolver

Jump to

Keyboard shortcuts

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