logf

package
v1.4.46 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Code generated by ksf2go 1.3.28, DO NOT EDIT. This file was generated from LogF.ksf Package logf comment

Code generated by ksf2go 1.3.28, DO NOT EDIT. This file was generated from LogF.ksf Package logf comment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	// contains filtered or unexported fields
}

Log struct

func NewLog added in v1.4.38

func NewLog() *Log

NewLog creates a new Log servant.

func (*Log) AllEndpoints added in v1.4.39

func (obj *Log) AllEndpoints() (active []*endpoint.Endpoint, inactive []*endpoint.Endpoint)

Endpoints returns all endpoint.Endpoint

func (*Log) Dispatch

func (obj *Log) Dispatch(ksfCtx context.Context, val interface{}, ksfReq *requestf.RequestPacket, ksfResp *requestf.ResponsePacket, withContext bool) (err error)

Dispatch is used to call the server side implement for the method defined in the ksf file. withContext shows using context or not.

func (*Log) Endpoints added in v1.4.38

func (obj *Log) Endpoints() (active []*endpoint.Endpoint)

Endpoints returns all active endpoint.Endpoint

func (*Log) GetServant added in v1.4.38

func (obj *Log) GetServant() (servant *model.Servant)

GetServant gets servant for the service.

func (*Log) KsfPing added in v1.4.38

func (obj *Log) KsfPing() error

KsfPing

func (*Log) KsfPingWithContext added in v1.4.38

func (obj *Log) KsfPingWithContext(ksfCtx context.Context) error

KsfPingWithContext

func (*Log) KsfSetProtocol

func (obj *Log) KsfSetProtocol(p model.Protocol)

KsfSetProtocol sets the protocol for the servant.

func (*Log) KsfSetTimeout

func (obj *Log) KsfSetTimeout(timeout int)

KsfSetTimeout sets the timeout for the servant which is in ms.

func (*Log) KsfSetVersion added in v1.4.46

func (obj *Log) KsfSetVersion(version int16)

KsfSetVersion default as KSFVERSION,you can set JSONVERSION.

func (*Log) Logger

func (obj *Log) Logger(app string, server string, file string, format string, buffer []string, opts ...map[string]string) error

Logger is the proxy function for the method defined in the ksf file, with the context

func (*Log) LoggerOneWayWithContext

func (obj *Log) LoggerOneWayWithContext(ksfCtx context.Context, app string, server string, file string, format string, buffer []string, opts ...map[string]string) (err error)

LoggerOneWayWithContext is the proxy function for the method defined in the ksf file, with the context

func (*Log) LoggerWithContext

func (obj *Log) LoggerWithContext(ksfCtx context.Context, app string, server string, file string, format string, buffer []string, opts ...map[string]string) (err error)

LoggerWithContext is the proxy function for the method defined in the ksf file, with the context

func (*Log) LoggerbyInfo

func (obj *Log) LoggerbyInfo(info *LogInfo, buffer []string, opts ...map[string]string) error

LoggerbyInfo is the proxy function for the method defined in the ksf file, with the context

func (*Log) LoggerbyInfoOneWayWithContext

func (obj *Log) LoggerbyInfoOneWayWithContext(ksfCtx context.Context, info *LogInfo, buffer []string, opts ...map[string]string) (err error)

LoggerbyInfoOneWayWithContext is the proxy function for the method defined in the ksf file, with the context

func (*Log) LoggerbyInfoWithContext

func (obj *Log) LoggerbyInfoWithContext(ksfCtx context.Context, info *LogInfo, buffer []string, opts ...map[string]string) (err error)

LoggerbyInfoWithContext is the proxy function for the method defined in the ksf file, with the context

func (*Log) SetOnCloseCallback added in v1.4.38

func (obj *Log) SetOnCloseCallback(callback func(string))

SetOnCloseCallback

func (*Log) SetOnConnectCallback added in v1.4.38

func (obj *Log) SetOnConnectCallback(callback func(string))

SetOnConnectCallback

func (*Log) SetPushCallback added in v1.4.38

func (obj *Log) SetPushCallback(callback func([]byte))

SetPushCallback

func (*Log) SetServant

func (obj *Log) SetServant(servant model.Servant)

SetServant sets servant for the service.

type LogInfo

type LogInfo struct {
	Appname           string `json:"appname" ksf:"appname,tag:0,require:true"`
	Servername        string `json:"servername" ksf:"servername,tag:1,require:true"`
	SFilename         string `json:"sFilename" ksf:"sFilename,tag:2,require:true"`
	SFormat           string `json:"sFormat" ksf:"sFormat,tag:3,require:true"`
	Setdivision       string `json:"setdivision" ksf:"setdivision,tag:4,require:false"`
	BHasSufix         bool   `json:"bHasSufix" ksf:"bHasSufix,tag:5,require:false"`
	BHasAppNamePrefix bool   `json:"bHasAppNamePrefix" ksf:"bHasAppNamePrefix,tag:6,require:false"`
	BHasSquareBracket bool   `json:"bHasSquareBracket" ksf:"bHasSquareBracket,tag:7,require:false"`
	SConcatStr        string `json:"sConcatStr" ksf:"sConcatStr,tag:8,require:false"`
	SSepar            string `json:"sSepar" ksf:"sSepar,tag:9,require:false"`
	SLogType          string `json:"sLogType" ksf:"sLogType,tag:10,require:false"`
}

LogInfo struct implement

func (*LogInfo) ReadBlock

func (st *LogInfo) ReadBlock(readBuf *codec.Reader, tag byte, require bool) error

ReadBlock reads struct from the given tag , require or optional.

func (*LogInfo) ReadFrom

func (st *LogInfo) ReadFrom(readBuf *codec.Reader) error

ReadFrom reads from readBuf and put into struct.

func (*LogInfo) ResetDefault

func (st *LogInfo) ResetDefault()

func (*LogInfo) WriteBlock

func (st *LogInfo) WriteBlock(buf *codec.Buffer, tag byte) error

WriteBlock encode struct

func (*LogInfo) WriteTo

func (st *LogInfo) WriteTo(buf *codec.Buffer) (err error)

WriteTo encode struct to buffer

type LogServant

type LogServant interface {
	Logger(app string, server string, file string, format string, buffer []string) (err error)
	LoggerbyInfo(info *LogInfo, buffer []string) (err error)
}

type LogServantWithContext

type LogServantWithContext interface {
	Logger(ksfCtx context.Context, app string, server string, file string, format string, buffer []string) (err error)
	LoggerbyInfo(ksfCtx context.Context, info *LogInfo, buffer []string) (err error)
	DoClose(ctx context.Context)
}

Jump to

Keyboard shortcuts

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