notifyf

package
v1.4.41 Latest Latest
Warning

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

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

Documentation

Overview

Code generated by ksf2go 1.3.22, DO NOT EDIT. This file was generated from /home/cc/workspace/KsfGo/ksf/protocol/res/NotifyF.ksf Package notifyf comment

Code generated by ksf2go 1.3.22, DO NOT EDIT. This file was generated from /home/cc/workspace/KsfGo/ksf/protocol/res/NotifyF.ksf 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 added in v1.4.38

func NewNotify() *Notify

NewNotify creates a new Notify servant.

func (*Notify) AllEndpoints added in v1.4.39

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

Endpoints returns all endpoint.Endpoint

func (*Notify) Dispatch

func (obj *Notify) 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 (*Notify) Endpoints added in v1.4.38

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

Endpoints returns all active endpoint.Endpoint

func (*Notify) GetNotifyInfo

func (obj *Notify) GetNotifyInfo(stKey *NotifyKey, stInfo *NotifyInfo, opts ...map[string]string) (int32, error)

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

func (*Notify) GetNotifyInfoOneWayWithContext

func (obj *Notify) GetNotifyInfoOneWayWithContext(ksfCtx context.Context, stKey *NotifyKey, stInfo *NotifyInfo, opts ...map[string]string) (ret int32, err error)

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

func (*Notify) GetNotifyInfoWithContext

func (obj *Notify) GetNotifyInfoWithContext(ksfCtx context.Context, stKey *NotifyKey, stInfo *NotifyInfo, opts ...map[string]string) (ret int32, err error)

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

func (*Notify) GetServant added in v1.4.38

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

GetServant gets servant for the service.

func (*Notify) KsfPing added in v1.4.38

func (obj *Notify) KsfPing()

KsfPing

func (*Notify) KsfPingWithContext added in v1.4.38

func (obj *Notify) KsfPingWithContext(ksfCtx context.Context)

KsfPingWithContext

func (*Notify) KsfSetProtocol

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

KsfSetProtocol sets the protocol for the servant.

func (*Notify) KsfSetTimeout

func (obj *Notify) KsfSetTimeout(timeout int)

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

func (*Notify) NotifyServer

func (obj *Notify) NotifyServer(sServerName string, level NOTIFYLEVEL, sMessage string, opts ...map[string]string) error

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

func (*Notify) NotifyServerOneWayWithContext

func (obj *Notify) NotifyServerOneWayWithContext(ksfCtx context.Context, sServerName string, level NOTIFYLEVEL, sMessage string, opts ...map[string]string) (err error)

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

func (*Notify) NotifyServerWithContext

func (obj *Notify) NotifyServerWithContext(ksfCtx context.Context, sServerName string, level NOTIFYLEVEL, sMessage string, opts ...map[string]string) (err error)

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

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

func (*Notify) ReportNotifyInfoOneWayWithContext

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

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

func (*Notify) ReportNotifyInfoWithContext

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

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

func (*Notify) ReportServer

func (obj *Notify) ReportServer(sServerName string, sThreadId string, sMessage string, opts ...map[string]string) error

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

func (*Notify) ReportServerOneWayWithContext

func (obj *Notify) ReportServerOneWayWithContext(ksfCtx context.Context, sServerName string, sThreadId string, sMessage string, opts ...map[string]string) (err error)

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

func (*Notify) ReportServerWithContext

func (obj *Notify) ReportServerWithContext(ksfCtx context.Context, sServerName string, sThreadId string, sMessage string, opts ...map[string]string) (err error)

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

func (*Notify) SetOnCloseCallback added in v1.4.38

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

SetOnCloseCallback

func (*Notify) SetOnConnectCallback added in v1.4.38

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

SetOnConnectCallback

func (*Notify) SetPushCallback added in v1.4.38

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

SetPushCallback

func (*Notify) SetServant

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

SetServant sets servant for the service.

type NotifyInfo

type NotifyInfo struct {
	Nextpage    int32        `json:"nextpage" ksf:"nextpage,tag:1,require:true"`
	NotifyItems []NotifyItem `json:"notifyItems" ksf:"notifyItems,tag:2,require:true"`
}

NotifyInfo struct implement

func (*NotifyInfo) ReadBlock

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

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

func (*NotifyInfo) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*NotifyInfo) ResetDefault

func (st *NotifyInfo) ResetDefault()

func (*NotifyInfo) WriteBlock

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

WriteBlock encode struct

func (*NotifyInfo) WriteTo

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

WriteTo encode struct to buffer

type NotifyItem

type NotifyItem struct {
	STimeStamp string `json:"sTimeStamp" ksf:"sTimeStamp,tag:1,require:true"`
	SServerId  string `json:"sServerId" ksf:"sServerId,tag:2,require:true"`
	ILevel     int32  `json:"iLevel" ksf:"iLevel,tag:3,require:true"`
	SMessage   string `json:"sMessage" ksf:"sMessage,tag:4,require:true"`
}

NotifyItem struct implement

func (*NotifyItem) ReadBlock

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

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

func (*NotifyItem) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*NotifyItem) ResetDefault

func (st *NotifyItem) ResetDefault()

func (*NotifyItem) WriteBlock

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

WriteBlock encode struct

func (*NotifyItem) WriteTo

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

WriteTo encode struct to buffer

type NotifyKey

type NotifyKey struct {
	Name string `json:"name" ksf:"name,tag:1,require:true"`
	Ip   string `json:"ip" ksf:"ip,tag:2,require:true"`
	Page int32  `json:"page" ksf:"page,tag:3,require:true"`
}

NotifyKey struct implement

func (*NotifyKey) ReadBlock

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

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

func (*NotifyKey) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*NotifyKey) ResetDefault

func (st *NotifyKey) ResetDefault()

func (*NotifyKey) WriteBlock

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

WriteBlock encode struct

func (*NotifyKey) WriteTo

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

WriteTo encode struct to buffer

type NotifyServant

type NotifyServant interface {
	ReportServer(sServerName string, sThreadId string, sMessage string) (err error)
	NotifyServer(sServerName string, level NOTIFYLEVEL, sMessage string) (err error)
	GetNotifyInfo(stKey *NotifyKey, stInfo *NotifyInfo) (ret int32, err error)
	ReportNotifyInfo(info *ReportInfo) (err error)
}

type NotifyServantWithContext

type NotifyServantWithContext interface {
	ReportServer(ksfCtx context.Context, sServerName string, sThreadId string, sMessage string) (err error)
	NotifyServer(ksfCtx context.Context, sServerName string, level NOTIFYLEVEL, sMessage string) (err error)
	GetNotifyInfo(ksfCtx context.Context, stKey *NotifyKey, stInfo *NotifyInfo) (ret int32, err error)
	ReportNotifyInfo(ksfCtx context.Context, info *ReportInfo) (err error)
	DoClose(ctx context.Context)
}

type ReportInfo

type ReportInfo struct {
	EType      ReportType  `json:"eType" ksf:"eType,tag:1,require:true"`
	SApp       string      `json:"sApp" ksf:"sApp,tag:2,require:true"`
	SSet       string      `json:"sSet" ksf:"sSet,tag:3,require:true"`
	SContainer string      `json:"sContainer" ksf:"sContainer,tag:4,require:true"`
	SServer    string      `json:"sServer" ksf:"sServer,tag:5,require:true"`
	SMessage   string      `json:"sMessage" ksf:"sMessage,tag:6,require:true"`
	SThreadId  string      `json:"sThreadId" ksf:"sThreadId,tag:7,require:false"`
	ELevel     NOTIFYLEVEL `json:"eLevel" ksf:"eLevel,tag:8,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