Documentation
¶
Index ¶
- Constants
- Variables
- func LoadExtendConf(filePath string, v interface{}) error
- func LocalIP() (net.IP, error)
- func LocalMacAddr() (string, error)
- func RandString(length int, characters ...byte) string
- func SetExtendTag(tag string)
- func SetPathTag(tag string)
- func SetRoot(r string)
- type APIHandleError
Constants ¶
View Source
const ( // EnvoyTLSSocketName matched with hardcoded built-in Envoy transport name which determines endpoint // level tls transport socket configuration EnvoyTLSSocketName = "envoy.transport_sockets.tls" )
Variables ¶
View Source
var ( ErrNotFound = errors.New("Record not found.") ErrValueMayChanged = errors.New("The value has been changed by others on this time.") ErrEmptyJobName = errors.New("Name of job is empty.") ErrEmptyJobCommand = errors.New("Command of job is empty.") ErrIllegalJobId = errors.New("Invalid id that includes illegal characters such as '/'.") ErrIllegalJobGroupName = errors.New("Invalid job group name that includes illegal characters such as '/'.") ErrEmptyNodeGroupName = errors.New("Name of node group is empty.") ErrIllegalNodeGroupId = errors.New("Invalid node group id that includes illegal characters such as '/'.") ErrSecurityInvalidCmd = errors.New("Security error: the suffix of script file is not on the whitelist.") ErrSecurityInvalidUser = errors.New("Security error: the user is not on the whitelist.") ErrNilRule = errors.New("invalid job rule, empty timer.") )
Functions ¶
func LoadExtendConf ¶
LoadExtendConf loads the json (configurable extension field) configuration file
func RandString ¶
func SetExtendTag ¶
func SetExtendTag(tag string)
SetExtendTag sets the extension tag, if not set, the default is'@extend:'
func SetPathTag ¶
func SetPathTag(tag string)
SetPathTag sets the current path tag, if not set, the default is'@pwd@' @pwd@ will be replaced with the path of the current file, As to whether it is an absolute path or a relative path, it depends on whether the passed in is an absolute path or a relative path when reading the file
Types ¶
type APIHandleError ¶
APIHandleError handle create err for api
func CreateAPIHandleError ¶
func CreateAPIHandleError(code int, err error) *APIHandleError
CreateAPIHandleError
func CreateAPIHandleErrorFromDBError ¶
func CreateAPIHandleErrorFromDBError(msg string, err error) *APIHandleError
CreateAPIHandleErrorFromDBError
func (*APIHandleError) Error ¶
func (a *APIHandleError) Error() string
func (*APIHandleError) Handle ¶
func (a *APIHandleError) Handle(r *http.Request, w http.ResponseWriter)
Handle
func (*APIHandleError) String ¶
func (a *APIHandleError) String() string
Click to show internal directories.
Click to hide internal directories.