server

package
v2.15.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceGoTSRPCProxyGetByKey   = "GetByKey"
	ServiceGoTSRPCProxyGetName    = "GetName"
	ServiceGoTSRPCProxyGetValue   = "GetValue"
	ServiceGoTSRPCProxyGetWrapped = "GetWrapped"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base[T any] interface {
	GetValue(ctx context.Context) T
}

type HTTPServiceGoTSRPCClient

type HTTPServiceGoTSRPCClient struct {
	URL      string
	EndPoint string
	Client   gotsrpc.Client
}

func NewDefaultServiceGoTSRPCClient

func NewDefaultServiceGoTSRPCClient(url string) *HTTPServiceGoTSRPCClient

func NewServiceGoTSRPCClient

func NewServiceGoTSRPCClient(url string, endpoint string) *HTTPServiceGoTSRPCClient

func NewServiceGoTSRPCClientWithClient

func NewServiceGoTSRPCClientWithClient(url string, endpoint string, client *go_net_http.Client) *HTTPServiceGoTSRPCClient

func (*HTTPServiceGoTSRPCClient) GetByKey

func (tsc *HTTPServiceGoTSRPCClient) GetByKey(ctx go_context.Context, key string) (retGetByKey_0 int, clientErr error)

func (*HTTPServiceGoTSRPCClient) GetName

func (tsc *HTTPServiceGoTSRPCClient) GetName(ctx go_context.Context) (retGetName_0 string, clientErr error)

func (*HTTPServiceGoTSRPCClient) GetValue

func (tsc *HTTPServiceGoTSRPCClient) GetValue(ctx go_context.Context) (retGetValue_0 github_com_foomo_gotsrpc_v2_tests_common.Item, clientErr error)

func (*HTTPServiceGoTSRPCClient) GetWrapped

type Handler

type Handler struct{}

func (*Handler) GetByKey

func (h *Handler) GetByKey(_ context.Context, key string) int

func (*Handler) GetName

func (h *Handler) GetName(_ context.Context) string

func (*Handler) GetValue

func (h *Handler) GetValue(_ context.Context) common.Item

func (*Handler) GetWrapped

func (h *Handler) GetWrapped(_ context.Context) common.Response[common.Item]

type Keyed

type Keyed[K comparable, V any] interface {
	GetByKey(ctx context.Context, key K) V
}

type Middle

type Middle[T any] interface {
	Base[T]
	GetWrapped(ctx context.Context) common.Response[T]
}

type Service

type Service interface {
	Middle[common.Item]
	Keyed[string, int]
	GetName(ctx context.Context) string
}

type ServiceGetByKeyRequest

type ServiceGetByKeyRequest struct {
	Key string
}

type ServiceGetByKeyResponse

type ServiceGetByKeyResponse struct {
	RetGetByKey_0 int
}

type ServiceGetNameRequest

type ServiceGetNameRequest struct {
}

type ServiceGetNameResponse

type ServiceGetNameResponse struct {
	RetGetName_0 string
}

type ServiceGetValueRequest

type ServiceGetValueRequest struct {
}

type ServiceGetValueResponse

type ServiceGetValueResponse struct {
	RetGetValue_0 github_com_foomo_gotsrpc_v2_tests_common.Item
}

type ServiceGetWrappedRequest

type ServiceGetWrappedRequest struct {
}

type ServiceGoRPCClient

type ServiceGoRPCClient struct {
	Client *gorpc.Client
}

func NewServiceGoRPCClient

func NewServiceGoRPCClient(addr string, tlsConfig *tls.Config) *ServiceGoRPCClient

func (*ServiceGoRPCClient) GetByKey

func (tsc *ServiceGoRPCClient) GetByKey(key string) (retGetByKey_0 int, clientErr error)

func (*ServiceGoRPCClient) GetName

func (tsc *ServiceGoRPCClient) GetName() (retGetName_0 string, clientErr error)

func (*ServiceGoRPCClient) GetValue

func (tsc *ServiceGoRPCClient) GetValue() (retGetValue_0 github_com_foomo_gotsrpc_v2_tests_common.Item, clientErr error)

func (*ServiceGoRPCClient) GetWrapped

func (*ServiceGoRPCClient) Start

func (tsc *ServiceGoRPCClient) Start()

func (*ServiceGoRPCClient) Stop

func (tsc *ServiceGoRPCClient) Stop()

type ServiceGoRPCProxy

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

func NewServiceGoRPCProxy

func NewServiceGoRPCProxy(addr string, service Service, tlsConfig *tls.Config) *ServiceGoRPCProxy

func (*ServiceGoRPCProxy) Serve

func (p *ServiceGoRPCProxy) Serve() error

func (*ServiceGoRPCProxy) SetCallStatsHandler

func (p *ServiceGoRPCProxy) SetCallStatsHandler(handler gotsrpc.GoRPCCallStatsHandlerFun)

func (*ServiceGoRPCProxy) Start

func (p *ServiceGoRPCProxy) Start() error

func (*ServiceGoRPCProxy) Stop

func (p *ServiceGoRPCProxy) Stop()

type ServiceGoTSRPCClient

type ServiceGoTSRPCClient interface {
	GetByKey(ctx go_context.Context, key string) (retGetByKey_0 int, clientErr error)
	GetName(ctx go_context.Context) (retGetName_0 string, clientErr error)
	GetValue(ctx go_context.Context) (retGetValue_0 github_com_foomo_gotsrpc_v2_tests_common.Item, clientErr error)
	GetWrapped(ctx go_context.Context) (retGetWrapped_0 github_com_foomo_gotsrpc_v2_tests_common.Response[github_com_foomo_gotsrpc_v2_tests_common.Item], clientErr error)
}

type ServiceGoTSRPCProxy

type ServiceGoTSRPCProxy struct {
	EndPoint string
	// contains filtered or unexported fields
}

func NewDefaultServiceGoTSRPCProxy

func NewDefaultServiceGoTSRPCProxy(service Service) *ServiceGoTSRPCProxy

func NewServiceGoTSRPCProxy

func NewServiceGoTSRPCProxy(service Service, endpoint string) *ServiceGoTSRPCProxy

func (*ServiceGoTSRPCProxy) ServeHTTP

func (p *ServiceGoTSRPCProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP exposes your service

Jump to

Keyboard shortcuts

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