userlog

package
v0.0.0-...-d691e2b Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLogWriter

func RegisterLogWriter(logtype string, creator LogCreator)

Types

type LogCreator

type LogCreator func(string, int) (UserLogFile, error)

type UserLog

type UserLog struct {
	Created        time.Time `json:"ts"`
	RequestID      string    `json:"rid"`
	FunctionBrn    string    `json:"brn,omitempty"`
	TriggerType    string    `json:"triggerType,omitempty"`
	RuntimeID      string    `json:"runtimeID,omitempty"`
	FuncName       string    `json:"func,omitempty"`
	Version        string    `json:"version,omitempty"`
	UserID         string    `json:"userid,omitempty"`
	Source         string    `json:"src"`
	Message        []byte    `json:"msg"`
	InvocationTime int64     `json:"invocationTime,omitempty"`
	MemoryUsage    int64     `json:"memoryUsage,omitempty"`
	Mode           string    `json:"invokeMode, omitempty"`
	ResponseStatus int       `json:"responseStatus, omitempty"`
}

UserLog marshals encoded JSONLog objects

func (*UserLog) MarshalJSONBuf

func (mj *UserLog) MarshalJSONBuf(buf *bytes.Buffer) error

MarshalJSONBuf is an optimized JSON marshaller that avoids reflection and unnecessary allocation.

func (*UserLog) Reset

func (l *UserLog) Reset()

type UserLogFile

type UserLogFile interface {
	Write(l *UserLog, buf []byte) (int, error)
	Close() error
}

func CreateLogWriter

func CreateLogWriter(logtype string, fpath string, cap int) (UserLogFile, error)

Directories

Path Synopsis
Package plain
Package plain

Jump to

Keyboard shortcuts

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