logf

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: BSD-3-Clause Imports: 12 Imported by: 2

Documentation

Overview

Code generated by tars2go 1.2.3, DO NOT EDIT. This file was generated from LogF.tars Package logf comment

Code generated by tars2go 1.2.3, DO NOT EDIT. This file was generated from LogF.tars 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.5

func NewLog() *Log

NewLog creates a new Log servant.

func (*Log) Dispatch

func (obj *Log) Dispatch(tarsCtx context.Context, val interface{}, tarsReq *requestf.RequestPacket, tarsResp *requestf.ResponsePacket, withContext bool) (err error)

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

func (*Log) Endpoints added in v1.4.1

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

Endpoints returns all active endpoint.Endpoint

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 tars file, with the context

func (*Log) LoggerOneWayWithContext added in v1.2.0

func (obj *Log) LoggerOneWayWithContext(tarsCtx 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 tars file, with the context

func (*Log) LoggerWithContext

func (obj *Log) LoggerWithContext(tarsCtx 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 tars 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 tars file, with the context

func (*Log) LoggerbyInfoOneWayWithContext added in v1.2.0

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

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

func (*Log) LoggerbyInfoWithContext

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

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

func (*Log) SetServant

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

SetServant sets servant for the service.

func (*Log) TarsSetProtocol added in v1.2.0

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

TarsSetProtocol sets the protocol for the servant.

func (*Log) TarsSetTimeout

func (obj *Log) TarsSetTimeout(timeout int)

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

type LogInfo

type LogInfo struct {
	Appname           string `json:"appname" tars:"appname,tag:0,require:true"`
	Servername        string `json:"servername" tars:"servername,tag:1,require:true"`
	SFilename         string `json:"sFilename" tars:"sFilename,tag:2,require:true"`
	SFormat           string `json:"sFormat" tars:"sFormat,tag:3,require:true"`
	Setdivision       string `json:"setdivision" tars:"setdivision,tag:4,require:false"`
	BHasSufix         bool   `json:"bHasSufix" tars:"bHasSufix,tag:5,require:false"`
	BHasAppNamePrefix bool   `json:"bHasAppNamePrefix" tars:"bHasAppNamePrefix,tag:6,require:false"`
	BHasSquareBracket bool   `json:"bHasSquareBracket" tars:"bHasSquareBracket,tag:7,require:false"`
	SConcatStr        string `json:"sConcatStr" tars:"sConcatStr,tag:8,require:false"`
	SSepar            string `json:"sSepar" tars:"sSepar,tag:9,require:false"`
	SLogType          string `json:"sLogType" tars:"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 added in v1.2.0

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 added in v1.3.0

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 added in v1.3.0

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

Jump to

Keyboard shortcuts

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