common

package
v0.0.0-...-649a59b Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NOTE: raw path like ./application.toml is recommended,
	// but path written with a prefix 'classpath' is also supported.
	APPLICATION_CONFIG_FILE = "classpath:application.toml"

	TEMPLATE_URL           = "http://127.0.0.1:8250/"
	XA_TRANSACTION_ID_KEY  = "XA_TRANSACTION_ID"
	XA_TRANSACTION_SEQ_KEY = "XA_TRANSACTION_SEQ"

	// alphabet(upper or lower case) + digit + character("_-") ,length in (4,16)
	USERNAME_PATTERN = "^[a-zA-Z0-9_-]{4,16}$"

	//alphabet(upper or lower case) + digit + character("@+!%*#?") ,length in (4,16)
	PASSWORD_PATTERN = "^[A-Za-z0-9@+!%*#?]{1,16}$"

	SSL_OFF            = 2
	SSL_ON             = 1
	SSL_ON_CLIENT_AUTH = 0
)

Variables

View Source
var CURRENT_VERSION = "1"

version

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode int // 0 is success
const (
	INTERNAL_ERROR ErrorCode = 100

	// config
	FIELD_MISSING  ErrorCode = 101
	RESOURCE_ERROR ErrorCode = 102
	ILLEGAL_SYMBOL ErrorCode = 103

	// rpc
	REMOTECALL_ERROR    ErrorCode = 201
	RPC_ERROR           ErrorCode = 202
	CALL_CONTRACT_ERROR ErrorCode = 203
	LACK_AUTHENTICATION ErrorCode = 204

	// performance
	RESOURCE_INACTIVE ErrorCode = 301
	INVALID_CONTRACT  ErrorCode = 302
)

func (ErrorCode) ToString

func (ec ErrorCode) ToString() string

type StatusCode

type StatusCode int
const (
	SUCCESS StatusCode = 0
	FAIL    StatusCode = -1
)

type WeCrossSDKError

type WeCrossSDKError struct {
	Code    ErrorCode
	Content string
}

func NewWeCrossSDKFromError

func NewWeCrossSDKFromError(errorCode ErrorCode, err error) *WeCrossSDKError

func NewWeCrossSDKFromString

func NewWeCrossSDKFromString(errorCode ErrorCode, content string) *WeCrossSDKError

func (*WeCrossSDKError) Error

func (w *WeCrossSDKError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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