authf

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: 0

Documentation

Overview

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

Code generated by tars2go 1.2.3, DO NOT EDIT. This file was generated from AuthF.tars 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" tars:"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" tars:"sKey,tag:1,require:true"`
	SToken string   `json:"sToken" tars:"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) ApplyToken

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

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

func (*Auth) ApplyTokenOneWayWithContext

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

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

func (*Auth) ApplyTokenWithContext

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

ApplyTokenWithContext is the proxy function for the method defined in the tars 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 tars file, with the context

func (*Auth) AuthProcessOneWayWithContext

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

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

func (*Auth) AuthProcessWithContext

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

AuthProcessWithContext is the proxy function for the method defined in the tars 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 tars file, with the context

func (*Auth) DeleteTokenOneWayWithContext

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

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

func (*Auth) DeleteTokenWithContext

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

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

func (*Auth) Dispatch

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

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

Endpoints returns all active endpoint.Endpoint

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

func (*Auth) GetTokensOneWayWithContext

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

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

func (*Auth) GetTokensWithContext

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

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

func (*Auth) SetServant

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

SetServant sets servant for the service.

func (*Auth) TarsSetProtocol

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

TarsSetProtocol sets the protocol for the servant.

func (*Auth) TarsSetTimeout

func (obj *Auth) TarsSetTimeout(timeout int)

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

type AuthRequest

type AuthRequest struct {
	SKey   TokenKey `json:"sKey" tars:"sKey,tag:1,require:true"`
	SToken string   `json:"sToken" tars:"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(tarsCtx context.Context, request *AuthRequest) (ret int32, err error)
	GetTokens(tarsCtx context.Context, request *TokenRequest) (ret []TokenResponse, err error)
	ApplyToken(tarsCtx context.Context, request *ApplyTokenRequest) (ret ApplyTokenResponse, err error)
	DeleteToken(tarsCtx context.Context, request *DeleteTokenRequest) (ret int32, err error)
}

type BasicAuthInfo

type BasicAuthInfo struct {
	SObjName        string `json:"sObjName" tars:"sObjName,tag:1,require:false"`
	SAccessKey      string `json:"sAccessKey" tars:"sAccessKey,tag:2,require:false"`
	SSecretKey      string `json:"sSecretKey" tars:"sSecretKey,tag:3,require:false"`
	SHashSecretKey2 string `json:"sHashSecretKey2" tars:"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" tars:"sObjName,tag:1,require:true"`
	SAccessKey  string `json:"sAccessKey" tars:"sAccessKey,tag:2,require:true"`
	ITime       int64  `json:"iTime" tars:"iTime,tag:3,require:true"`
	SHashMethod string `json:"sHashMethod" tars:"sHashMethod,tag:4,require:false"`
	SSignature  string `json:"sSignature" tars:"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" tars:"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" tars:"sApplication,tag:1,require:true"`
	SServer      string `json:"sServer" tars:"sServer,tag:2,require:true"`
	SObjName     string `json:"sObjName" tars:"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" tars:"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" tars:"sObjName,tag:1,require:true"`
	MTokens  map[string]string `json:"mTokens" tars:"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