api_client

package
v0.0.0-...-595e2a2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthSignature

type AuthSignature struct {
	Signer          crypt_utils.ESigner
	EndpoindsConfig auth.EndpointsAuthConfig
}

func (*AuthSignature) HandleResponse

func (a *AuthSignature) HandleResponse(resp OperationResponse)

func (*AuthSignature) MakeHeaders

func (a *AuthSignature) MakeHeaders(ctx op_context.Context, operation api.Operation, cmd interface{}) (map[string]string, error)

type AuthSignatureBase

type AuthSignatureBase struct {
	AuthSignatureBaseConfig
	AuthSignature
	// contains filtered or unexported fields
}

func NewAuthSignature

func NewAuthSignature() *AuthSignatureBase

func (*AuthSignatureBase) Config

func (a *AuthSignatureBase) Config() interface{}

func (*AuthSignatureBase) Construct

func (c *AuthSignatureBase) Construct()

func (*AuthSignatureBase) Init

func (a *AuthSignatureBase) Init(cfg config.Config, log logger.Logger, vld validator.Validator, configPath ...string) error

type AuthSignatureBaseConfig

type AuthSignatureBaseConfig struct {
	PRIVATE_KEY_FILE     string `validate:"required"`
	PRIVATE_KEY_PASSWORD string `mask:"true"`
}

type AuthSms

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

func NewAuthSms

func NewAuthSms() *AuthSms

func (*AuthSms) HandleResponse

func (a *AuthSms) HandleResponse(resp OperationResponse)

func (*AuthSms) MakeHeaders

func (a *AuthSms) MakeHeaders(ctx op_context.Context, operation api.Operation, cmd interface{}) (map[string]string, error)

func (*AuthSms) SetCode

func (a *AuthSms) SetCode(code string)

type AutoReconnectHandlers

type AutoReconnectHandlers interface {
	GetRefreshToken() string
	SaveRefreshToken(ctx op_context.Context, token string)
	GetCredentials(ctx op_context.Context) (login string, password string, err error)
}

type Client

type Client interface {
	Exec(ctx op_context.Context, operation api.Operation, cmd interface{}, response interface{}, tenancy ...multitenancy.TenancyPath) error
	Transport() interface{}
	SetPropagateAuthUser(val bool)
	SetPropagateContextId(val bool)
}

type ClientOperation

type ClientOperation interface {
	Exec(client Client, ctx op_context.Context, operation api.Operation) error
}

type EmbeddedClientHandlers

type EmbeddedClientHandlers struct {
	app_context.WithAppBase
	EmbeddedClientHandlersConfig
}

func NewEmbeddedClientHandlers

func NewEmbeddedClientHandlers(app app_context.Context) *EmbeddedClientHandlers

func (*EmbeddedClientHandlers) Config

func (e *EmbeddedClientHandlers) Config() interface{}

func (*EmbeddedClientHandlers) GetCredentials

func (e *EmbeddedClientHandlers) GetCredentials(ctx op_context.Context) (login string, password string, err error)

func (*EmbeddedClientHandlers) GetRefreshToken

func (e *EmbeddedClientHandlers) GetRefreshToken() string

func (*EmbeddedClientHandlers) InitDirect

func (e *EmbeddedClientHandlers) InitDirect(ctx op_context.Context, login string, password string, tokenCacheKey string) error

func (*EmbeddedClientHandlers) InitFromConfig

func (e *EmbeddedClientHandlers) InitFromConfig(configPath ...string) error

func (*EmbeddedClientHandlers) SaveRefreshToken

func (e *EmbeddedClientHandlers) SaveRefreshToken(ctx op_context.Context, token string)

type EmbeddedClientHandlersConfig

type EmbeddedClientHandlersConfig struct {
	TOKEN_CACHE_KEY string `validate:"required" default:"client_refresh_token"`
	LOGIN           string `validate:"required"`
	PASSWORD        string `mask:"true"`
}

type Handler

type Handler[Request any, Result any] struct {
	Request *Request
	Result  *Result
}

func NewHandler

func NewHandler[Request any, Result any](request *Request, result *Result) *Handler[Request, Result]

func (*Handler[Request, Result]) Exec

func (h *Handler[Request, Result]) Exec(client Client, ctx op_context.Context, operation api.Operation) error

type HandlerInTenancy

type HandlerInTenancy[Cmd any, Result any] struct {
	Cmd    *Cmd
	Result *Result
}

func NewHandlerInTenancy

func NewHandlerInTenancy[Cmd any, Result any](cmd *Cmd, result *Result) *HandlerInTenancy[Cmd, Result]

func (*HandlerInTenancy[Cmd, Result]) Exec

func (h *HandlerInTenancy[Cmd, Result]) Exec(client Client, ctx multitenancy.TenancyContext, operation api.Operation) error

type HandlerInTenancyCmd

type HandlerInTenancyCmd[Cmd any] struct {
	Cmd *Cmd
}

func NewHandlerInTenancyCmd

func NewHandlerInTenancyCmd[Cmd any](cmd *Cmd) *HandlerInTenancyCmd[Cmd]

func (*HandlerInTenancyCmd[Cmd]) Exec

func (h *HandlerInTenancyCmd[Cmd]) Exec(client Client, ctx multitenancy.TenancyContext, operation api.Operation) error

type HandlerInTenancyNil

type HandlerInTenancyNil struct {
}

func NewHandlerInTenancyNil

func NewHandlerInTenancyNil() *HandlerInTenancyNil

func (*HandlerInTenancyNil) Exec

func (h *HandlerInTenancyNil) Exec(client Client, ctx multitenancy.TenancyContext, operation api.Operation) error

type HandlerInTenancyResult

type HandlerInTenancyResult[Result any] struct {
	Result *Result
}

func NewHandlerInTenancyResult

func NewHandlerInTenancyResult[Result any](result *Result) *HandlerInTenancyResult[Result]

func (*HandlerInTenancyResult[Result]) Exec

func (h *HandlerInTenancyResult[Result]) Exec(client Client, ctx multitenancy.TenancyContext, operation api.Operation) error

type HandlerNil

type HandlerNil struct {
}

func NewHandlerNil

func NewHandlerNil() *HandlerNil

func (*HandlerNil) Exec

func (h *HandlerNil) Exec(client Client, ctx op_context.Context, operation api.Operation) error

type HandlerRequest

type HandlerRequest[Request any] struct {
	Request *Request
}

func NewHandlerRequest

func NewHandlerRequest[Request any](request *Request) *HandlerRequest[Request]

func (*HandlerRequest[Request]) Exec

func (h *HandlerRequest[Request]) Exec(client Client, ctx op_context.Context, operation api.Operation) error

type HandlerResult

type HandlerResult[Result any] struct {
	Result *Result
}

func NewHandlerResult

func NewHandlerResult[Result any](result *Result) *HandlerResult[Result]

func (*HandlerResult[Result]) Exec

func (h *HandlerResult[Result]) Exec(client Client, ctx op_context.Context, operation api.Operation) error

type InteractiveClientHandlers

type InteractiveClientHandlers struct {
	app_context.WithAppBase
	InteractiveClientHandlersConfig
}

func NewInteractiveClientHandlers

func NewInteractiveClientHandlers(app app_context.Context) *InteractiveClientHandlers

func (*InteractiveClientHandlers) Config

func (e *InteractiveClientHandlers) Config() interface{}

func (*InteractiveClientHandlers) GetCredentials

func (e *InteractiveClientHandlers) GetCredentials(ctx op_context.Context) (string, string, error)

func (*InteractiveClientHandlers) GetRefreshToken

func (e *InteractiveClientHandlers) GetRefreshToken() string

func (*InteractiveClientHandlers) Init

func (e *InteractiveClientHandlers) Init(configPath ...string) error

func (*InteractiveClientHandlers) SaveRefreshToken

func (e *InteractiveClientHandlers) SaveRefreshToken(ctx op_context.Context, token string)

type InteractiveClientHandlersConfig

type InteractiveClientHandlersConfig struct {
	TOKEN_FILE_NAME string `validate:"required,file"`
}

type OperationResponse

type OperationResponse interface {
	SetHeader(key string, value string)
	GetHeader(key string) string
	Code() int
	Error() generic_error.Error
	SetError(err generic_error.Error)
}

type ServiceClient

type ServiceClient struct {
	generic_error.ErrorsExtenderStub
	api.ResourceBase
	// contains filtered or unexported fields
}

func (*ServiceClient) ApiClient

func (s *ServiceClient) ApiClient() Client

func (*ServiceClient) Client

func (s *ServiceClient) Client() Client

func (*ServiceClient) Init

func (s *ServiceClient) Init(client Client, serviceName string)

type TenancyClientOperation

type TenancyClientOperation interface {
	Exec(client Client, ctx multitenancy.TenancyContext, operation api.Operation) error
}

type TokenKeeper

type TokenKeeper struct {
	Token string `json:"token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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