Documentation ¶
Index ¶
- Constants
- func BoolMaybeDeNil(s *bool) bool
- func Exists(path string) (bool, error)
- func FuncName(skip int) string
- func Int32to64(i *int32) *int64
- func IntMaybeDefault(s *int, def int) int
- func JsonStr(r interface{}) string
- func Jsonify(r interface{}) json.RawMessage
- func ListSubFolders(path string) ([]string, error)
- func Max(x, y int) int
- func MaybeAssignStr(s **string, defStr string)
- func MaybeCreate(folder string) error
- func MaybeDefault[T any](s *T, v T) T
- func MaybeNil[T any](s *T) (res T)
- func Min(x, y int) int
- func NewDiff(path string, from, to DiffMarshaler) (*Diff, *Result)
- func NewJsonDiff[T any](path string, from, to *T) (*Diff, *Result)
- func NewString(v string) *string
- func Ptr[T any](v T) *T
- func SameResult(lh, rh *Result) bool
- func StrMaybeDefault(s *string, defStr string) string
- func StrMaybeNil(s *string) string
- func SumSlice(s []int) int
- type Diff
- type DiffMarshaler
- type Result
- func ErrResult(err error) *Result
- func Error(ctx string, err error) *Result
- func Errorf(format string, a ...interface{}) *Result
- func GetAPIUrl(baseUrl, endpoint string) (string, *Result)
- func GetUrl(baseUrl, endpoint string) (string, *Result)
- func ListFiles(folder string) ([]string, *Result)
- func LogError(l *zerolog.Logger, ctx string, err error) *Result
- func LogMsgError(logger *zerolog.Logger, ctx string, msg string) *Result
- func MsgError(ctx string, msg string) *Result
- func NewErrResult(ctx string, r interface{}) *Result
- func NewResult(ctx string, r interface{}) *Result
- func OK(ctx string) *Result
Constants ¶
View Source
const ( DiffAdd string = "add" DiffDel string = "delete" DiffMod string = "modify" DiffEq string = "eq" )
Variables ¶
This section is empty.
Functions ¶
func BoolMaybeDeNil ¶
func IntMaybeDefault ¶
func Jsonify ¶
func Jsonify(r interface{}) json.RawMessage
func ListSubFolders ¶
func MaybeAssignStr ¶
func MaybeCreate ¶
func MaybeDefault ¶
func MaybeDefault[T any](s *T, v T) T
func NewJsonDiff ¶ added in v0.5.0
func SameResult ¶ added in v0.2.1
func StrMaybeDefault ¶
func StrMaybeNil ¶
Types ¶
type Diff ¶ added in v0.5.0
type DiffMarshaler ¶ added in v0.5.0
type Result ¶
type Result struct { Code int `json:"code"` Msg string `json:"message"` Ctx string `json:"context"` Timestamp time.Time `json:"timestamp"` Result interface{} `json:"result"` Inner *Result `json:"inner,omitempty"` }
func LogMsgError ¶ added in v0.4.2
func NewErrResult ¶
func (Result) GetRootCause ¶
Click to show internal directories.
Click to hide internal directories.