authf

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/AuthF.ksf Package authf comment

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AUTH_STATE

type AUTH_STATE int32
const (
	AUTH_STATE_AUTH_INIT            AUTH_STATE = -127
	AUTH_STATE_AUTH_SUCC            AUTH_STATE = 0
	AUTH_STATE_AUTH_PROTO_ERR       AUTH_STATE = -100
	AUTH_STATE_AUTH_WRONG_OBJ       AUTH_STATE = -101
	AUTH_STATE_AUTH_WRONG_AK        AUTH_STATE = -102
	AUTH_STATE_AUTH_WRONG_TIME      AUTH_STATE = -103
	AUTH_STATE_AUTH_NOT_SUPPORT_ENC AUTH_STATE = -104
	AUTH_STATE_AUTH_DEC_FAIL        AUTH_STATE = -105
	AUTH_STATE_AUTH_ERROR           AUTH_STATE = -106
)

type AUTH_TYPE

type AUTH_TYPE int32
const (
	AUTH_TYPE_AUTH_TYPENONE  AUTH_TYPE = 0
	AUTH_TYPE_AUTH_TYPELOCAL AUTH_TYPE = 1
)

type ApplyTokenRequest

type ApplyTokenRequest struct {
	SKey TokenKey `json:"sKey" ksf:"sKey,tag:1,require:true"`
}

ApplyTokenRequest struct implement

func (*ApplyTokenRequest) ReadBlock

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

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

func (*ApplyTokenRequest) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*ApplyTokenRequest) ResetDefault

func (st *ApplyTokenRequest) ResetDefault()

func (*ApplyTokenRequest) WriteBlock

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

WriteBlock encode struct

func (*ApplyTokenRequest) WriteTo

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

WriteTo encode struct to buffer

type ApplyTokenResponse

type ApplyTokenResponse struct {
	SKey   TokenKey `json:"sKey" ksf:"sKey,tag:1,require:true"`
	SToken string   `json:"sToken" ksf:"sToken,tag:2,require:true"`
}

ApplyTokenResponse struct implement

func (*ApplyTokenResponse) ReadBlock

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

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

func (*ApplyTokenResponse) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*ApplyTokenResponse) ResetDefault

func (st *ApplyTokenResponse) ResetDefault()

func (*ApplyTokenResponse) WriteBlock

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

WriteBlock encode struct

func (*ApplyTokenResponse) WriteTo

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

WriteTo encode struct to buffer

type Auth

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

Auth struct

func NewAuth

func NewAuth() *Auth

NewAuth creates a new Auth servant.

func (*Auth) AllEndpoints added in v1.4.39

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

Endpoints returns all endpoint.Endpoint

func (*Auth) ApplyToken

func (obj *Auth) ApplyToken(request *ApplyTokenRequest, opts ...map[string]string) (ApplyTokenResponse, error)

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

func (*Auth) ApplyTokenOneWayWithContext

func (obj *Auth) ApplyTokenOneWayWithContext(ksfCtx context.Context, request *ApplyTokenRequest, opts ...map[string]string) (ret ApplyTokenResponse, err error)

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

func (*Auth) ApplyTokenWithContext

func (obj *Auth) ApplyTokenWithContext(ksfCtx context.Context, request *ApplyTokenRequest, opts ...map[string]string) (ret ApplyTokenResponse, err error)

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

func (*Auth) AuthProcess

func (obj *Auth) AuthProcess(request *AuthRequest, opts ...map[string]string) (int32, error)

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

func (*Auth) AuthProcessOneWayWithContext

func (obj *Auth) AuthProcessOneWayWithContext(ksfCtx context.Context, request *AuthRequest, opts ...map[string]string) (ret int32, err error)

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

func (*Auth) AuthProcessWithContext

func (obj *Auth) AuthProcessWithContext(ksfCtx context.Context, request *AuthRequest, opts ...map[string]string) (ret int32, err error)

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

func (*Auth) DeleteToken

func (obj *Auth) DeleteToken(request *DeleteTokenRequest, opts ...map[string]string) (int32, error)

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

func (*Auth) DeleteTokenOneWayWithContext

func (obj *Auth) DeleteTokenOneWayWithContext(ksfCtx context.Context, request *DeleteTokenRequest, opts ...map[string]string) (ret int32, err error)

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

func (*Auth) DeleteTokenWithContext

func (obj *Auth) DeleteTokenWithContext(ksfCtx context.Context, request *DeleteTokenRequest, opts ...map[string]string) (ret int32, err error)

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

func (*Auth) Dispatch

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

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

Endpoints returns all active endpoint.Endpoint

func (*Auth) GetServant

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

GetServant gets servant for the service.

func (*Auth) GetTokens

func (obj *Auth) GetTokens(request *TokenRequest, opts ...map[string]string) ([]TokenResponse, error)

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

func (*Auth) GetTokensOneWayWithContext

func (obj *Auth) GetTokensOneWayWithContext(ksfCtx context.Context, request *TokenRequest, opts ...map[string]string) (ret []TokenResponse, err error)

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

func (*Auth) GetTokensWithContext

func (obj *Auth) GetTokensWithContext(ksfCtx context.Context, request *TokenRequest, opts ...map[string]string) (ret []TokenResponse, err error)

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

func (*Auth) KsfPing

func (obj *Auth) KsfPing()

KsfPing

func (*Auth) KsfPingWithContext

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

KsfPingWithContext

func (*Auth) KsfSetProtocol

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

KsfSetProtocol sets the protocol for the servant.

func (*Auth) KsfSetTimeout

func (obj *Auth) KsfSetTimeout(timeout int)

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

func (*Auth) SetOnCloseCallback

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

SetOnCloseCallback

func (*Auth) SetOnConnectCallback

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

SetOnConnectCallback

func (*Auth) SetPushCallback

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

SetPushCallback

func (*Auth) SetServant

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

SetServant sets servant for the service.

type AuthRequest

type AuthRequest struct {
	SKey   TokenKey `json:"sKey" ksf:"sKey,tag:1,require:true"`
	SToken string   `json:"sToken" ksf:"sToken,tag:2,require:true"`
}

AuthRequest struct implement

func (*AuthRequest) ReadBlock

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

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

func (*AuthRequest) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*AuthRequest) ResetDefault

func (st *AuthRequest) ResetDefault()

func (*AuthRequest) WriteBlock

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

WriteBlock encode struct

func (*AuthRequest) WriteTo

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

WriteTo encode struct to buffer

type AuthServant

type AuthServant interface {
	AuthProcess(request *AuthRequest) (ret int32, err error)
	GetTokens(request *TokenRequest) (ret []TokenResponse, err error)
	ApplyToken(request *ApplyTokenRequest) (ret ApplyTokenResponse, err error)
	DeleteToken(request *DeleteTokenRequest) (ret int32, err error)
}

type AuthServantWithContext

type AuthServantWithContext interface {
	AuthProcess(ksfCtx context.Context, request *AuthRequest) (ret int32, err error)
	GetTokens(ksfCtx context.Context, request *TokenRequest) (ret []TokenResponse, err error)
	ApplyToken(ksfCtx context.Context, request *ApplyTokenRequest) (ret ApplyTokenResponse, err error)
	DeleteToken(ksfCtx context.Context, request *DeleteTokenRequest) (ret int32, err error)
	DoClose(ctx context.Context)
}

type BasicAuthInfo

type BasicAuthInfo struct {
	SObjName        string `json:"sObjName" ksf:"sObjName,tag:1,require:false"`
	SAccessKey      string `json:"sAccessKey" ksf:"sAccessKey,tag:2,require:false"`
	SSecretKey      string `json:"sSecretKey" ksf:"sSecretKey,tag:3,require:false"`
	SHashSecretKey2 string `json:"sHashSecretKey2" ksf:"sHashSecretKey2,tag:4,require:false"`
}

BasicAuthInfo struct implement

func (*BasicAuthInfo) ReadBlock

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

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

func (*BasicAuthInfo) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*BasicAuthInfo) ResetDefault

func (st *BasicAuthInfo) ResetDefault()

func (*BasicAuthInfo) WriteBlock

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

WriteBlock encode struct

func (*BasicAuthInfo) WriteTo

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

WriteTo encode struct to buffer

type BasicAuthPackage

type BasicAuthPackage struct {
	SObjName    string `json:"sObjName" ksf:"sObjName,tag:1,require:true"`
	SAccessKey  string `json:"sAccessKey" ksf:"sAccessKey,tag:2,require:true"`
	ITime       int64  `json:"iTime" ksf:"iTime,tag:3,require:true"`
	SHashMethod string `json:"sHashMethod" ksf:"sHashMethod,tag:4,require:false"`
	SSignature  string `json:"sSignature" ksf:"sSignature,tag:5,require:false"`
}

BasicAuthPackage struct implement

func (*BasicAuthPackage) ReadBlock

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

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

func (*BasicAuthPackage) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*BasicAuthPackage) ResetDefault

func (st *BasicAuthPackage) ResetDefault()

func (*BasicAuthPackage) WriteBlock

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

WriteBlock encode struct

func (*BasicAuthPackage) WriteTo

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

WriteTo encode struct to buffer

type DeleteTokenRequest

type DeleteTokenRequest struct {
	SKey TokenKey `json:"sKey" ksf:"sKey,tag:1,require:true"`
}

DeleteTokenRequest struct implement

func (*DeleteTokenRequest) ReadBlock

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

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

func (*DeleteTokenRequest) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*DeleteTokenRequest) ResetDefault

func (st *DeleteTokenRequest) ResetDefault()

func (*DeleteTokenRequest) WriteBlock

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

WriteBlock encode struct

func (*DeleteTokenRequest) WriteTo

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

WriteTo encode struct to buffer

type TokenKey

type TokenKey struct {
	SApplication string `json:"sApplication" ksf:"sApplication,tag:1,require:true"`
	SServer      string `json:"sServer" ksf:"sServer,tag:2,require:true"`
	SObjName     string `json:"sObjName" ksf:"sObjName,tag:3,require:true"`
}

TokenKey struct implement

func (*TokenKey) ReadBlock

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

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

func (*TokenKey) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*TokenKey) ResetDefault

func (st *TokenKey) ResetDefault()

func (*TokenKey) WriteBlock

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

WriteBlock encode struct

func (*TokenKey) WriteTo

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

WriteTo encode struct to buffer

type TokenRequest

type TokenRequest struct {
	VObjName []string `json:"vObjName" ksf:"vObjName,tag:1,require:true"`
}

TokenRequest struct implement

func (*TokenRequest) ReadBlock

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

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

func (*TokenRequest) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*TokenRequest) ResetDefault

func (st *TokenRequest) ResetDefault()

func (*TokenRequest) WriteBlock

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

WriteBlock encode struct

func (*TokenRequest) WriteTo

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

WriteTo encode struct to buffer

type TokenResponse

type TokenResponse struct {
	SObjName string            `json:"sObjName" ksf:"sObjName,tag:1,require:true"`
	MTokens  map[string]string `json:"mTokens" ksf:"mTokens,tag:2,require:true"`
}

TokenResponse struct implement

func (*TokenResponse) ReadBlock

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

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

func (*TokenResponse) ReadFrom

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

ReadFrom reads from readBuf and put into struct.

func (*TokenResponse) ResetDefault

func (st *TokenResponse) ResetDefault()

func (*TokenResponse) WriteBlock

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

WriteBlock encode struct

func (*TokenResponse) WriteTo

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

WriteTo encode struct to buffer

Jump to

Keyboard shortcuts

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