logutils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Unimplemented indicator
	Unimplemented string = "Unimplemented"

	// StatusValid data status
	StatusValid MessageDataStatus = "Valid"
	// StatusInvalid data status
	StatusInvalid MessageDataStatus = "Invalid"
	// StatusFound data status
	StatusFound MessageDataStatus = "Found"
	// StatusMissing data status
	StatusMissing MessageDataStatus = "Missing"
	// StatusEnabled data status
	StatusEnabled MessageDataStatus = "Enabled"
	// StatusDisabled data status
	StatusDisabled MessageDataStatus = "Disabled"

	// StatusSuccess action status
	StatusSuccess MessageActionStatus = "Success"
	// StatusError action status
	StatusError MessageActionStatus = "Error"

	// TypeArg data type
	TypeArg MessageDataType = "arg"
	// TypeTransaction data type
	TypeTransaction MessageDataType = "transaction"
	// TypeResult data type
	TypeResult MessageDataType = "result"

	// TypeInt data type
	TypeInt MessageDataType = "int"
	// TypeUint data type
	TypeUint MessageDataType = "uint"
	// TypeFloat data type
	TypeFloat MessageDataType = "float"
	// TypeBool data type
	TypeBool MessageDataType = "bool"
	// TypeString data type
	TypeString MessageDataType = "string"
	// TypeByte data type
	TypeByte MessageDataType = "byte"
	// TypeError data type
	TypeError MessageDataType = "error"
	// TypeTime data type
	TypeTime MessageDataType = "time"

	// TypeRequest data type
	TypeRequest MessageDataType = "request"
	// TypeRequestBody data type
	TypeRequestBody MessageDataType = "request body"
	// TypeResponse data type
	TypeResponse MessageDataType = "response"
	// TypeResponseBody data type
	TypeResponseBody MessageDataType = "response body"
	// TypeQueryParam data type
	TypeQueryParam MessageDataType = "query param"
	// TypePathParam data type
	TypePathParam MessageDataType = "path param"
	// TypeHeader data type
	TypeHeader MessageDataType = "header"

	// TypeToken data type
	TypeToken MessageDataType = "token"
	// TypeClaims data type
	TypeClaims MessageDataType = "claims"
	// TypeClaim data type
	TypeClaim MessageDataType = "claim"
	// TypeScope data type
	TypeScope MessageDataType = "scope"
	// TypePermission data type
	TypePermission MessageDataType = "permission"

	// ActionInitialize action type
	ActionInitialize MessageActionType = "initializing"
	// ActionCompute action type
	ActionCompute MessageActionType = "computing"
	// ActionRegister action type
	ActionRegister MessageActionType = "registering"
	// ActionDeregister action type
	ActionDeregister MessageActionType = "deregistering"
	// ActionStart action type
	ActionStart MessageActionType = "starting"
	// ActionCommit action type
	ActionCommit MessageActionType = "committing"
	// ActionRefresh action type
	ActionRefresh MessageActionType = "refreshing"
	// ActionGenerate action type
	ActionGenerate MessageActionType = "generating"
	// ActionApply action type
	ActionApply MessageActionType = "applying"
	// ActionVerify action type
	ActionVerify MessageActionType = "verifying"
	// ActionPrepare action type
	ActionPrepare MessageActionType = "preparing"

	// ActionEncrypt action type
	ActionEncrypt MessageActionType = "encrypting"
	// ActionDecrypt action type
	ActionDecrypt MessageActionType = "decrypting"

	// ActionSend action type
	ActionSend MessageActionType = "sending"
	// ActionRead action type
	ActionRead MessageActionType = "reading"

	// ActionParse action type
	ActionParse MessageActionType = "parsing"
	// ActionEncode action type
	ActionEncode MessageActionType = "encoding"
	// ActionDecode action type
	ActionDecode MessageActionType = "decoding"

	// ActionMarshal action type
	ActionMarshal MessageActionType = "marshalling"
	// ActionUnmarshal action type
	ActionUnmarshal MessageActionType = "unmarshalling"
	// ActionValidate action type
	ActionValidate MessageActionType = "validating"
	// ActionCast action type
	ActionCast MessageActionType = "casting to"

	// ActionCache action type
	ActionCache MessageActionType = "caching"
	// ActionLoadCache action type
	ActionLoadCache MessageActionType = "loading cached"

	// ActionGrant action type
	ActionGrant MessageActionType = "granting"
	// ActionRevoke action type
	ActionRevoke MessageActionType = "revoking"

	// ActionGet action type
	ActionGet MessageActionType = "getting"
	// ActionCreate action type
	ActionCreate MessageActionType = "creating"
	// ActionUpdate action type
	ActionUpdate MessageActionType = "updating"
	// ActionDelete action type
	ActionDelete MessageActionType = "deleting"

	// ActionLoad action type
	ActionLoad MessageActionType = "loading"
	// ActionFind action type
	ActionFind MessageActionType = "finding"
	// ActionInsert action type
	ActionInsert MessageActionType = "inserting"
	// ActionReplace action type
	ActionReplace MessageActionType = "replacing"
	// ActionSave action type
	ActionSave MessageActionType = "saving"
	// ActionCount action type
	ActionCount MessageActionType = "counting"
)

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(slice []string, val string) bool

ContainsString returns true if the provided string slice contains the provided string value

func GetFuncName

func GetFuncName(numFrames int) string

GetFuncName fetches the name of a function caller based on the numFrames

func MessageAction

func MessageAction(status MessageActionStatus, action MessageActionType, dataType MessageDataType, args MessageArgs) string

MessageAction generates a message string for an action

status: The status of the action
action: The action that is occurring
dataType: The data type that the action is occurring on
args: Any args that should be included in the message (nil if none)

func MessageActionError

func MessageActionError(action MessageActionType, dataType MessageDataType, args MessageArgs) string

MessageActionError generates a message string for an action that resulted in an error

action: The action that is occurring
dataType: The data type that the action is occurring on
args: Any args that should be included in the message (nil if none)

func MessageActionSuccess

func MessageActionSuccess(action MessageActionType, dataType MessageDataType, args MessageArgs) string

MessageActionSuccess generates a message string for an action that succeeded

action: The action that is occurring
dataType: The data type that the action is occurring on
args: Any args that should be included in the message (nil if none)

func MessageData

func MessageData(status MessageDataStatus, dataType MessageDataType, args MessageArgs) string

MessageData generates a message string for a data element

status: The status of the data
dataType: The data type
args: Any args that should be included in the message (nil if none)

Types

type FieldArgs

type FieldArgs Fields

FieldArgs are MessageArgs in the form of Fields

func (*FieldArgs) String

func (f *FieldArgs) String() string

type Fields

type Fields map[string]interface{}

Fields represents fields to be printed in a MessageDataType message

func (Fields) ToMap

func (f Fields) ToMap() map[string]interface{}

ToMap converts the fields to a standard map[string]interface{}

type ListArgs

type ListArgs []string

ListArgs are MessageArgs in the form of a list

func (*ListArgs) String

func (l *ListArgs) String() string

type MessageActionStatus

type MessageActionStatus string

MessageActionStatus represent the status of the action in an ActionMessage

type MessageActionType

type MessageActionType string

MessageActionType represents the type that the action was performed on in an ActionMessage

type MessageArgs

type MessageArgs interface {
	String() string
}

MessageArgs is an interface for arguments to be included in a message

type MessageDataStatus

type MessageDataStatus string

MessageDataStatus represent the status of the data in a DataMessage

type MessageDataType

type MessageDataType string

MessageDataType represents the type of the data in a DataMessage

type StringArgs

type StringArgs string

StringArgs are MessageArgs in the form of a string

func (StringArgs) String

func (s StringArgs) String() string

Jump to

Keyboard shortcuts

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