utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

README

utils

This package goaldly contains utility functions.

Documentation

Overview

------------------------------------------------------------------------------------------------ Ensuring we have a very limited use of the 'reflect' package. THIS FILE SHOULD BE THE ONLY PLACE WHERE WE IMPORT THE REFLECT PACKAGE! Basically, we only want to use reflection: - 1) when generating code (which then precisely allows to avoid reflection) - 2) in init functions NEVER DURING THE RUNTIME! At least not in OUR code (but some 3rd party libraries prolly do) ------------------------------------------------------------------------------------------------

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFnName

func GetFnName(fn any) string

returning the name of the given function

func TypeNameOf

func TypeNameOf(arg any, bare bool) string

Types

type Country

type Country int
const (
	CountryUNDEFINED Country = iota
	CountryFRANCE    Country = 1
)

func (Country) String

func (thisCountry Country) String() string

func (Country) Val

func (thisCountry Country) Val() int

Val helps implement the IEnum interface

func (Country) Values

func (thisCountry Country) Values() map[int]string

Values helps implement the IEnum interface

type GoaldField

type GoaldField struct {
	// contains filtered or unexported fields
}

func (GoaldField) IsAnonymous

func (f GoaldField) IsAnonymous() bool

func (GoaldField) Name

func (f GoaldField) Name() string

func (GoaldField) Tag

func (f GoaldField) Tag() reflect.StructTag

func (GoaldField) Type

func (f GoaldField) Type() GoaldType

type GoaldType

type GoaldType struct {
	// contains filtered or unexported fields
}

func PointerTo

func PointerTo(arg GoaldType) GoaldType

func TypeOf

func TypeOf(arg any, bare bool) GoaldType

func (GoaldType) Elem

func (t GoaldType) Elem() GoaldType

func (GoaldType) Equals

func (t GoaldType) Equals(other GoaldType) bool

func (GoaldType) Field

func (t GoaldType) Field(index int) GoaldField

func (GoaldType) FieldByName

func (t GoaldType) FieldByName(name string) GoaldField

func (GoaldType) Implements

func (t GoaldType) Implements(other GoaldType) bool

func (GoaldType) Name

func (t GoaldType) Name() string

func (GoaldType) NumField

func (t GoaldType) NumField() int

func (GoaldType) PkgPath

func (t GoaldType) PkgPath() string

func (GoaldType) String

func (t GoaldType) String() string

type GoaldValue

type GoaldValue struct {
	// contains filtered or unexported fields
}

func ValueOf

func ValueOf(arg any) GoaldValue

func (GoaldValue) GetFieldValue

func (thisValue GoaldValue) GetFieldValue(fieldName string) any

type Language

type Language int
const (
	LanguageUNDEFINED Language = iota
	LanguageFRENCH    Language = 1
	LanguageENGLISH   Language = 2
	LanguageGERMAN    Language = 3
	LanguageSPANISH   Language = 4
	LanguageITALIAN   Language = 5
	LanguageDUTCH     Language = 6
)

func (Language) String

func (thisLanguage Language) String() string

func (Language) Val

func (thisLanguage Language) Val() int

Val helps implement the IEnum interface

func (Language) Values

func (thisLanguage Language) Values() map[int]string

Values helps implement the IEnum interface

type TypeFamily

type TypeFamily int

TypeFamily represents the type of a business object's property

const (
	TypeFamilyUNKNOWN TypeFamily = iota - 1
	TypeFamilyBOOL
	TypeFamilySTRING
	TypeFamilyINT
	TypeFamilyBIGINT
	TypeFamilyREAL
	TypeFamilyDOUBLE
	TypeFamilyDATE
	TypeFamilyENUM
	TypeFamilyRELATIONSHIPxMONOM
	TypeFamilyRELATIONSHIPxPOLYM
)

func GetTypeFamily

func GetTypeFamily(field GoaldField, iBoTypeFamily, enumTypeFamily GoaldType) (TypeFamily TypeFamily, multiple bool)

GetTypeFamily returns the type family of a given structfield

func (TypeFamily) IsRelationship

func (thisProperty TypeFamily) IsRelationship() bool

Tells if we have a relationship here

func (TypeFamily) String

func (thisProperty TypeFamily) String() string

func (TypeFamily) Val

func (thisProperty TypeFamily) Val() int

Val helps implement the IEnum interface

func (TypeFamily) Values

func (thisProperty TypeFamily) Values() map[int]string

Values helps implement the IEnum interface

Jump to

Keyboard shortcuts

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