server

package
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceGoTSRPCProxyInlineStruct    = "InlineStruct"
	ServiceGoTSRPCProxyInlineStructPtr = "InlineStructPtr"
	ServiceGoTSRPCProxyUnionString     = "UnionString"
	ServiceGoTSRPCProxyUnionStruct     = "UnionStruct"
)
View Source
const (
	UnionStringAOne   UnionStringA = "one"
	UnionStringATwo   UnionStringA = "two"
	UnionStringBThree UnionStringB = "three"
	UnionStringBFour  UnionStringB = "four"
)
View Source
const (
	UnionStructAValueAOne   UnionStructAValueA = "one"
	UnionStructAValueATwo   UnionStructAValueA = "two"
	UnionStructAValueAThree UnionStructAValueA = "three"

	UnionStructAValueBOne   UnionStructAValueB = "one"
	UnionStructAValueBTwo   UnionStructAValueB = "two"
	UnionStructAValueBThree UnionStructAValueB = "three"
)

Variables

This section is empty.

Functions

This section is empty.

Types

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) InlineStruct

func (tsc *HTTPServiceGoTSRPCClient) InlineStruct(ctx go_context.Context) (e InlineStruct, clientErr error)

func (*HTTPServiceGoTSRPCClient) InlineStructPtr

func (tsc *HTTPServiceGoTSRPCClient) InlineStructPtr(ctx go_context.Context) (e InlineStructPtr, clientErr error)

func (*HTTPServiceGoTSRPCClient) UnionString

func (tsc *HTTPServiceGoTSRPCClient) UnionString(ctx go_context.Context) (e UnionString, clientErr error)

func (*HTTPServiceGoTSRPCClient) UnionStruct

func (tsc *HTTPServiceGoTSRPCClient) UnionStruct(ctx go_context.Context) (e UnionStruct, clientErr error)

type Handler

type Handler struct{}

func (*Handler) InlineStruct

func (h *Handler) InlineStruct(w http.ResponseWriter, r *http.Request) (e InlineStruct)

func (*Handler) InlineStructPtr

func (h *Handler) InlineStructPtr(w http.ResponseWriter, r *http.Request) (e InlineStructPtr)

func (*Handler) UnionString

func (h *Handler) UnionString(w http.ResponseWriter, r *http.Request) (e UnionString)

func (*Handler) UnionStruct

func (h *Handler) UnionStruct(w http.ResponseWriter, r *http.Request) (e UnionStruct)

type InlineStruct

type InlineStruct struct {
	InlineStructA `json:",inline"`
	InlineStructB `json:",inline"`
	Value         string `json:"value"`
}

type InlineStructA

type InlineStructA struct {
	ValueA string `json:"valueA"`
}

type InlineStructB

type InlineStructB struct {
	ValueB string `json:"valueB"`
}

type InlineStructPtr

type InlineStructPtr struct {
	*InlineStructA `json:",inline,omitempty"`
	*InlineStructB `json:",inline,omitempty"`
	Bug            *InlineStructB `json:"bug,omitempty"`
	Value          string         `json:"value"`
}

type Service

type Service interface {
	InlineStruct(w http.ResponseWriter, r *http.Request) (e InlineStruct)
	InlineStructPtr(w http.ResponseWriter, r *http.Request) (e InlineStructPtr)
	UnionString(w http.ResponseWriter, r *http.Request) (e UnionString)
	UnionStruct(w http.ResponseWriter, r *http.Request) (e UnionStruct)
}

type ServiceGoTSRPCClient

type ServiceGoTSRPCClient interface {
	InlineStruct(ctx go_context.Context) (e InlineStruct, clientErr error)
	InlineStructPtr(ctx go_context.Context) (e InlineStructPtr, clientErr error)
	UnionString(ctx go_context.Context) (e UnionString, clientErr error)
	UnionStruct(ctx go_context.Context) (e UnionStruct, 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

type UnionString

type UnionString struct {
	A *UnionStringA `json:"a,omitempty" gotsrpc:"union"`
	B *UnionStringB `json:"b,omitempty" gotsrpc:"union"`
}

type UnionStringA

type UnionStringA string

type UnionStringB

type UnionStringB string

type UnionStruct

type UnionStruct struct {
	A *UnionStructA `json:"a,omitempty" gotsrpc:"union"`
	B *UnionStructB `json:"b,omitempty" gotsrpc:"union"`
}

type UnionStructA

type UnionStructA struct {
	Kind  string             `json:"kind" gotsrpc:"type:'UnionStructA'"`
	Value UnionStructAValueA `json:"value"`
	Bar   string             `json:"bar"`
}

type UnionStructAValueA

type UnionStructAValueA string

type UnionStructAValueB

type UnionStructAValueB string

type UnionStructB

type UnionStructB struct {
	Kind  string             `json:"kind" gotsrpc:"type:'UnionStructB'"`
	Value UnionStructAValueB `json:"value"`
	Foo   string             `json:"foo"`
}

Jump to

Keyboard shortcuts

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