notifyf

package
v0.0.0-...-bc1b0c2 Latest Latest
Warning

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

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

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NOTIFYLEVEL

type NOTIFYLEVEL int32
const (
	NOTIFYLEVEL_NOTIFYNORMAL NOTIFYLEVEL = 0
	NOTIFYLEVEL_NOTIFYWARN   NOTIFYLEVEL = 1
	NOTIFYLEVEL_NOTIFYERROR  NOTIFYLEVEL = 2
)

type Notify

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

Notify struct

func NewNotify

func NewNotify() *Notify

NewNotify creates a new Notify servant.

func (*Notify) Dispatch

func (obj *Notify) 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 (*Notify) Endpoints

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

Endpoints returns all active endpoint.Endpoint

func (*Notify) ReportNotifyInfo

func (obj *Notify) ReportNotifyInfo(info *ReportInfo, opts ...map[string]string) error

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

func (*Notify) ReportNotifyInfoOneWayWithContext

func (obj *Notify) ReportNotifyInfoOneWayWithContext(tarsCtx context.Context, info *ReportInfo, opts ...map[string]string) (err error)

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

func (*Notify) ReportNotifyInfoWithContext

func (obj *Notify) ReportNotifyInfoWithContext(tarsCtx context.Context, info *ReportInfo, opts ...map[string]string) (err error)

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

func (*Notify) SetServant

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

SetServant sets servant for the service.

func (*Notify) TarsSetProtocol

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

TarsSetProtocol sets the protocol for the servant.

func (*Notify) TarsSetTimeout

func (obj *Notify) TarsSetTimeout(timeout int)

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

type NotifyServant

type NotifyServant interface {
	ReportNotifyInfo(info *ReportInfo) (err error)
}

type NotifyServantWithContext

type NotifyServantWithContext interface {
	ReportNotifyInfo(tarsCtx context.Context, info *ReportInfo) (err error)
}

type ReportInfo

type ReportInfo struct {
	EType      ReportType  `json:"eType" tars:"eType,tag:1,require:true"`
	SApp       string      `json:"sApp" tars:"sApp,tag:2,require:true"`
	SSet       string      `json:"sSet" tars:"sSet,tag:3,require:true"`
	SContainer string      `json:"sContainer" tars:"sContainer,tag:4,require:true"`
	SServer    string      `json:"sServer" tars:"sServer,tag:5,require:true"`
	SMessage   string      `json:"sMessage" tars:"sMessage,tag:6,require:true"`
	SThreadId  string      `json:"sThreadId" tars:"sThreadId,tag:7,require:false"`
	ELevel     NOTIFYLEVEL `json:"eLevel" tars:"eLevel,tag:8,require:false"`
	SNodeName  string      `json:"sNodeName" tars:"sNodeName,tag:9,require:false"`
}

ReportInfo struct implement

func (*ReportInfo) ReadBlock

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

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

func (*ReportInfo) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*ReportInfo) ResetDefault

func (st *ReportInfo) ResetDefault()

func (*ReportInfo) WriteBlock

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

WriteBlock encode struct

func (*ReportInfo) WriteTo

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

WriteTo encode struct to buffer

type ReportType

type ReportType int32
const (
	ReportType_REPORT ReportType = 0
	ReportType_NOTIFY ReportType = 1
)

Jump to

Keyboard shortcuts

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