cornerstone

package module
v0.0.0-...-9723791 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 10 Imported by: 28

README

cornerstone

  • context
  • error
  • tracing
  • logger

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx Context, v ...interface{})

func Debugf

func Debugf(ctx Context, f string, v ...interface{})

func DoneWithStatus

func DoneWithStatus(c *gin.Context, result interface{})

func Error

func Error(ctx Context, v ...interface{})

func Errorf

func Errorf(ctx Context, f string, v ...interface{})

func FromCodeErrorWithStatus

func FromCodeErrorWithStatus(c *gin.Context, err CodeError)

func GetAppName

func GetAppName() (result string)

func Info

func Info(ctx Context, v ...interface{})

func Infof

func Infof(ctx Context, f string, v ...interface{})

func Panic

func Panic(ctx Context, v ...interface{})

func Panicf

func Panicf(ctx Context, f string, v ...interface{})

func Trace

func Trace(ctx Context, v ...interface{})

func Tracef

func Tracef(ctx Context, f string, v ...interface{})

func Warn

func Warn(ctx Context, v ...interface{})

func Warnf

func Warnf(ctx Context, f string, v ...interface{})

Types

type CarrierCodeError

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

func FromNativeError

func FromNativeError(err error) (result CarrierCodeError)

func NewCarrierCodeError

func NewCarrierCodeError(ec, sec int, em string) (result CarrierCodeError)

func (CarrierCodeError) Error

func (err CarrierCodeError) Error() (msg string)

func (CarrierCodeError) ErrorCode

func (err CarrierCodeError) ErrorCode() (ec int)

func (CarrierCodeError) ErrorMessage

func (err CarrierCodeError) ErrorMessage() (em string)

func (CarrierCodeError) FullError

func (err CarrierCodeError) FullError() (msg string)

func (CarrierCodeError) SubErrorCode

func (err CarrierCodeError) SubErrorCode() (sec int)

type CodeError

type CodeError interface {
	ErrorCode() int
	SubErrorCode() int
	ErrorMessage() string
	Error() string
	FullError() string
}

type Context

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

func NewContext

func NewContext() (ctx Context)

func (*Context) CopyContext

func (ctx *Context) CopyContext() (result Context)

func (*Context) Deadline

func (ctx *Context) Deadline() (deadline time.Time, ok bool)

func (*Context) Done

func (ctx *Context) Done() (done <-chan struct{})

func (*Context) Err

func (ctx *Context) Err() (err error)

func (*Context) Get

func (ctx *Context) Get(key string) (result interface{}, ok bool)

func (*Context) GetAllMap

func (ctx *Context) GetAllMap() (result map[string]interface{})

func (*Context) GetBool

func (ctx *Context) GetBool(key string) (result bool, ok bool)

func (*Context) GetDuration

func (ctx *Context) GetDuration(key string) (result time.Duration, ok bool)

func (*Context) GetFloat64

func (ctx *Context) GetFloat64(key string) (result float64, ok bool)

func (*Context) GetInt

func (ctx *Context) GetInt(key string) (result int, ok bool)

func (*Context) GetIntSlice

func (ctx *Context) GetIntSlice(key string) (result []int, ok bool)

func (*Context) GetString

func (ctx *Context) GetString(key string) (result string, ok bool)

func (*Context) GetStringMap

func (ctx *Context) GetStringMap(key string) (result map[string]interface{}, ok bool)

func (*Context) GetStringMapString

func (ctx *Context) GetStringMapString(key string) (result map[string]string, ok bool)

func (*Context) GetStringSlice

func (ctx *Context) GetStringSlice(key string) (result []string, ok bool)

func (*Context) GetTime

func (ctx *Context) GetTime(key string) (result time.Time, ok bool)

func (*Context) IsSet

func (ctx *Context) IsSet(key string) (ok bool)

func (*Context) Set

func (ctx *Context) Set(key string, value interface{})

func (*Context) SetCancel

func (ctx *Context) SetCancel() (cancelFunc context.CancelFunc)

func (*Context) SetDeadline

func (ctx *Context) SetDeadline(deadline time.Time) (ok bool, cancelFunc context.CancelFunc)

func (*Context) SetTimeout

func (ctx *Context) SetTimeout(timeout time.Duration) (cancelFunc context.CancelFunc)

func (*Context) Value

func (ctx *Context) Value(key interface{}) (result interface{})

func (*Context) WithCancel

func (ctx *Context) WithCancel() (result Context, cancelFunc context.CancelFunc)

func (*Context) WithDeadline

func (ctx *Context) WithDeadline(deadline time.Time) (ok bool, result Context, cancelFunc context.CancelFunc)

func (*Context) WithTimeout

func (ctx *Context) WithTimeout(timeout time.Duration) (result Context, cancelFunc context.CancelFunc)

type Version

type Version struct {
	AppName    string `json:"app_name"`
	AppVersion string `json:"app_version"`
	GitBranch  string `json:"git_branch"`
	GitCommit  string `json:"git_commit"`
	BuildDate  string `json:"build_date"`
	GoOS       string `json:"go_os"`
	GoArch     string `json:"go_arch"`
	GoVer      string `json:"go_ver"`
}

func GetVersion

func GetVersion() (result Version)

Jump to

Keyboard shortcuts

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