adacorebase

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BigMsgLength = 4*1024*1024 - 1024

BigMsgLength -if msg length >= BigMsgLength, the message is big message

View Source
const DefaultBaseURL = "http://127.0.0.1/"

DefaultBaseURL - default baseurl

View Source
const DefaultIsAllowTemplateData = false

DefaultIsAllowTemplateData - Whether to allow templatedata

View Source
const DefaultMaxExpireTime = 24 * 60 * 60

DefaultMaxExpireTime - max expire time in seconds

View Source
const DefaultResNums = 0

DefaultResNums - This is the amount of resources available for this role

View Source
const DefaultTemplate = "default"

DefaultTemplate - This is default template available for this role.

View Source
const DefaultTemplatesPath = "./templates"

DefaultTemplatesPath - default templates file path

View Source
const VERSION = "0.3.9"

VERSION - adacore version

Variables

View Source
var (
	// ErrConfigNoAdaRenderServAddr - There is no AdaRenderServAddr in the configuration file
	ErrConfigNoAdaRenderServAddr = errors.New("There is no AdaRenderServAddr in the configuration file")
	// ErrConfigNoClientTokens - There is no ClientTokens in the configuration file
	ErrConfigNoClientTokens = errors.New("There is no ClientTokens in the configuration file")
	// ErrConfigNoAdaRenderToken - There is no AdaRenderToken in the configuration file
	ErrConfigNoAdaRenderToken = errors.New("There is no AdaRenderToken in the configuration file")
	// ErrConfigNoFilePath - There is no FilePath in the configuration file
	ErrConfigNoFilePath = errors.New("There is no FilePath in the configuration file")
	// ErrConfigNoBindAddr - There is no BindAddr in the configuration file
	ErrConfigNoBindAddr = errors.New("There is no BindAddr in the configuration file")

	// ErrAdaRenderClientNoServAddr - There is no ServAddr in AdaRenderClient
	ErrAdaRenderClientNoServAddr = errors.New("There is no ServAddr in AdaRenderClient")
	// ErrAdaRenderClientNoToken - There is no Token in AdaRenderClient
	ErrAdaRenderClientNoToken = errors.New("There is no Token in AdaRenderClient")

	// ErrAdaCoreDBInvalidHashName - There is invalid hashname in AdaCoreDB
	ErrAdaCoreDBInvalidHashName = errors.New("There is invalid hashname in AdaCoreDB")
	// ErrAdaCoreDBInvalidResList - There is invalid reslist in AdaCoreDB
	ErrAdaCoreDBInvalidResList = errors.New("There is invalid reslist in AdaCoreDB")

	// ErrServNoConfig - The config is invalid
	ErrServNoConfig = errors.New("The config is invalid")
	// ErrServInvalidToken - This token is invalid
	ErrServInvalidToken = errors.New("This token is invalid")
	// ErrServInvalidErrString - The err string is invalid
	ErrServInvalidErrString = errors.New("The err string is invalid")
	// ErrServInvalidResult - The result is invalid
	ErrServInvalidResult = errors.New("The result is invalid")

	// ErrEmptyHTMLData - The HTMLData is empty
	ErrEmptyHTMLData = errors.New("The HTMLData is empty")

	// ErrAdaCoreClientNoServAddr - There is no ServAddr in AdaCoreClient
	ErrAdaCoreClientNoServAddr = errors.New("There is no ServAddr in AdaCoreClient")
	// ErrAdaCoreClientNoToken - There is no Token in AdaCoreClient
	ErrAdaCoreClientNoToken = errors.New("There is no Token in AdaCoreClient")

	// ErrNoMarkdownData - The MarkdownData is empty
	ErrNoMarkdownData = errors.New("The MarkdownData is empty")

	// ErrInvalidHashDataAdaRender - invalid hashdata in adarender
	ErrInvalidHashDataAdaRender = errors.New("invalid hashdata in adarender")
	// ErrInvalidTotalHashDataAdaRender - invalid totalhashdata in adarender
	ErrInvalidTotalHashDataAdaRender = errors.New("invalid totalhashdata in adarender")
	// ErrInvalidCurStartAdaRender - invalid curstart in adarender
	ErrInvalidCurStartAdaRender = errors.New("invalid curstart in adarender")
	// ErrInvalidCurLengthAdaRender - invalid curlength in adarender
	ErrInvalidCurLengthAdaRender = errors.New("invalid curlength in adarender")
	// ErrInvalidTotalLengthAdaRender - invalid totallength in adarender
	ErrInvalidTotalLengthAdaRender = errors.New("invalid totallength in adarender")
)

Functions

func AppendString

func AppendString(strs ...string) string

AppendString - append string

func BuildLogFilename

func BuildLogFilename(logtype string, subname string) string

BuildLogFilename -

func BuildLogSubFilename

func BuildLogSubFilename(appName string, version string) string

BuildLogSubFilename -

func ClearLogs

func ClearLogs() error

ClearLogs - clear logs

func Debug

func Debug(message string, fields ...zap.Field)

Debug logs a debug message with the given fields

func Error

func Error(message string, fields ...zap.Field)

Error logs a debug message with the given fields

func Fatal

func Fatal(message string, fields ...zap.Field)

Fatal logs a message than calls os.Exit(1)

func GetCurTime

func GetCurTime() int64

GetCurTime - append string

func HashBuffer

func HashBuffer(buf []byte) string

HashBuffer - hash buffer

func Info

func Info(message string, fields ...zap.Field)

Info logs a debug message with the given fields

func InitLogger

func InitLogger(level zapcore.Level, isConsole bool, logpath string)

InitLogger - initializes a thread-safe singleton logger

func JSON

func JSON(key string, obj interface{}) zap.Field

JSON - make json to field

func MD5Buffer added in v0.1.56

func MD5Buffer(buf []byte) string

MD5Buffer - hash buffer

func SyncLogger

func SyncLogger()

SyncLogger - sync logger

func Warn

func Warn(message string, fields ...zap.Field)

Warn logs a debug message with the given fields

Types

This section is empty.

Jump to

Keyboard shortcuts

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