shared

package
v0.20.18 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ExecKindService = "service"
)

Variables

This section is empty.

Functions

func CloneHTTPRequest added in v0.8.0

func CloneHTTPRequest(request *http.Request) (*http.Request, error)

CloneHTTPRequest clones http request

func CombineErrors added in v0.8.0

func CombineErrors(header string, errors []error) error

func Elem added in v0.2.0

func Elem(rType reflect.Type) reflect.Type

func EnsureArgs added in v0.14.2

func EnsureArgs(query string, args *[]interface{})

func ExpandSQL added in v0.8.0

func ExpandSQL(SQL string, args []interface{}) string

func ExtractPath added in v0.8.0

func ExtractPath(name string) (string, string)

func FindModulePath added in v0.15.9

func FindModulePath(packagePath string) (string, error)

func FirstNotEmpty added in v0.8.0

func FirstNotEmpty(values ...string) string

func KeysOf added in v0.2.0

func KeysOf(value string, removeUnderscores bool) []string

KeysOf creates keys based on given value using different strategies i.e. ToUpper, ToLower.

func MatchField added in v0.2.0

func MatchField(rType reflect.Type, name string, sourceCase text.CaseFormat) *xunsafe.Field

func TrimPair added in v0.8.0

func TrimPair(text string, begin, end byte) string

func UnmarshalWithExt added in v0.8.0

func UnmarshalWithExt(data []byte, into interface{}, ext string) error

Types

type BuiltInKey added in v0.2.0

type BuiltInKey string

BuiltInKey represents keys that are provided as parameters for every view.View in view.Session

const (
	//DataViewName represents View.DbName parameter
	DataViewName BuiltInKey = "session.View.DbName"
	//SubjectName represents PrincialSubject parameter
	SubjectName BuiltInKey = "session.PrincialSubject"
)

type Errors added in v0.2.0

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

Errors collect errors, supports parallel errors collecting.

func NewErrors added in v0.2.0

func NewErrors(size int) *Errors

NewErrors creates and allocates errors collector with given size

func (*Errors) Append added in v0.2.0

func (r *Errors) Append(err error)

Append appends error.

func (*Errors) Error added in v0.2.0

func (r *Errors) Error() error

Error returns first encounter error if any

type Marshal added in v0.14.0

type Marshal func(src interface{}) ([]byte, error)

Marshal converts source to byte array

type Reference added in v0.2.0

type Reference struct {
	Ref string `json:",omitempty" yaml:"ref,omitempty"`
}

Reference wraps Ref, objects with Reference can be build based on other object of the same type.

type Unmarshal added in v0.8.0

type Unmarshal func(data []byte, destination interface{}) error

Unmarshal converts data to destination, destination has to be a pointer to desired output type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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