constant

package
v0.0.0-...-9edbc40 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DoHUB       = 12600
	DoLineHaul  = 12650
	DoSortir    = 2600
	OnProgress  = 2000
	OutBranch   = 3005
	OutHUB      = 3010
	OutLineHaul = 3050
	InHUB       = 4500
	InLineHaul  = 4550
	InBranch    = 3500
	InFilter    = 12800
	Antss       = 14000
	BA          = 22000
	CODA        = 23000
	CODB        = 26500
	CODOC       = 26550
	DLV         = 30000
	DoneHO      = 30100
	BROKE       = 24000
	RTN         = 24500
	RTC         = 24550
	RTS         = 25000
	THP         = 28500
	InSortir    = 13000
	Cancel      = 1800
	CancelDLV   = 21800
	Lost        = 23500
)

awb satus

View Source
const (
	//strict equal
	SE = "=="
	EQ = "="
	GT = ">"
	GE = ">="
	LT = "<"
	LE = "<="
	//regex
	RE = "~"
	NE = "!="
	SN = "!=="
	IN = "[]"
	EM = "{}"
)
View Source
const (
	// AppName
	AppName        = "poc-go-ulid"
	HeaderXTraceID = "X-Trace-Id"

	// Default
	DefaultPort     int = 8080
	DefaultLogLevel     = "info"

	MaxBodyLimit    = 1024 * 1024 * 12 // 12MB
	MaxReadTimeOut  = 60               // 60 seconds
	MaxWriteTimeOut = 60               // 60 seconds
)
View Source
const (
	TxKey         = dbConstKey("TxKey")
	MYSQL         = "mysql"
	POSTGRES      = "postgres"
	POSTGRES_CONN = `host=%s port=%d user=%s password=%s dbname=%s sslmode=disable`
)
View Source
const (
	StatusCtxKey                = 0
	StatusSuccess               = http.StatusOK
	StatusErrorForm             = http.StatusBadRequest
	StatusErrorUnknown          = http.StatusBadGateway
	StatusInternalError         = http.StatusInternalServerError
	StatusUnauthorized          = http.StatusUnauthorized
	StatusCreated               = http.StatusCreated
	StatusAccepted              = http.StatusAccepted
	StatusForbidden             = http.StatusForbidden
	StatusInvalidAuthentication = http.StatusProxyAuthRequired
	StatusNotFound              = http.StatusNotFound
)
View Source
const (
	UIDNodeBits     = 10
	UIDSequenceBits = 12
)
View Source
const (
	GRPCport = ":33339"
)

Variables

View Source
var (
	// Error Context
	ErrCtxDataNotExist = errors.New("the data not exist")

	ErrNotSupportedDisplayPayload = errors.New("not supported to display payload")
)

Functions

func StatusCode

func StatusCode(code int) string

func StatusText

func StatusText(code int) string

Types

type ContextKey

type ContextKey string
const (
	// Context Key
	ContextKeyLatency   ContextKey = "latency"
	ContextKeyRequestID ContextKey = "request_id"
	ContextKeyErrorResp ContextKey = "error_response"
)

func (ContextKey) Bool

func (c ContextKey) Bool(ctx context.Context) (bool, error)

func (ContextKey) Error

func (c ContextKey) Error(ctx context.Context) error

func (ContextKey) Float64

func (c ContextKey) Float64(ctx context.Context) (float64, error)

func (ContextKey) Int

func (c ContextKey) Int(ctx context.Context) (int, error)

func (ContextKey) Int64

func (c ContextKey) Int64(ctx context.Context) (int64, error)

func (ContextKey) String

func (c ContextKey) String(ctx context.Context) (string, error)

func (ContextKey) Time

func (c ContextKey) Time(ctx context.Context) (time.Time, error)

func (ContextKey) ToString

func (c ContextKey) ToString() string

Jump to

Keyboard shortcuts

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