mdl

package
v0.40.13 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: MIT Imports: 3 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 FirstNonEmpty added in v0.40.4

func FirstNonEmpty[T comparable](values ...T) T

func IsEmpty added in v0.40.4

func IsEmpty[T comparable](in T) bool

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