api_client

package
v0.0.0-...-8122643 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeOperationHandler

func MakeOperationHandler(client Client, clientOperation ClientOperation) api.OperationHandler

func MakeTenancyOperationHandler

func MakeTenancyOperationHandler(client Client, clientOperation TenancyClientOperation) api.TenancyOperationHandler

Types

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{}, tenancyPath ...string) 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[Cmd any, Result any] struct {
	Cmd    *Cmd
	Result *Result
}

func NewHandler

func NewHandler[Cmd any, Result any](cmd *Cmd, result *Result) *Handler[Cmd, Result]

func (*Handler[Cmd, Result]) Exec

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

type HandlerCmd

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

func NewHandlerCmd

func NewHandlerCmd[Cmd any](cmd *Cmd) *HandlerCmd[Cmd]

func (*HandlerCmd[Cmd]) Exec

func (h *HandlerCmd[Cmd]) 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 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 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