greeter

package
v0.0.0-...-216df3c Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type GreetRequest

type GreetRequest struct {
	Name string `json:"name,omitempty"`
}

type GreetResponse

type GreetResponse struct {
	ErrorResponse
	Message string `json:"message,omitempty"`
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Handler

type Handler interface {
	Check(c *gin.Context)
}
var HandlerSpec Handler = &handler{}

func NewHandler

func NewHandler() Handler

type Postcard

type Postcard struct {
	PictureURL string
	Address    string
	Recipient  string
	Message    string
}

type RPCHandler

type RPCHandler interface {
	Greet(ctx *gin.Context)
	SendPostcard(ctx *gin.Context)
}
var RPCHandlerSpec RPCHandler = &rpcHandler{}

func NewRPCHandler

func NewRPCHandler(
	svc Service,
	opt *RPCHandlerOptions,
) RPCHandler

type RPCHandlerOptions

type RPCHandlerOptions struct {
}

type SendPostcardRequest

type SendPostcardRequest struct {
	Card *Postcard `json:"card,omitempty"`
}

type SendPostcardResponse

type SendPostcardResponse struct {
	ErrorResponse
}

type Service

type Service interface {
	Greet(name string) (message string, err error)
	SendPostcard(card *Postcard) (err error)
}

func NewService

func NewService() Service

type ServiceClient

type ServiceClient interface {
	Service
}

func NewServiceClient

func NewServiceClient(
	httpClient HTTPClient,
	opt *ServiceClientOptions,
) ServiceClient

type ServiceClientOptions

type ServiceClientOptions struct {
}

Jump to

Keyboard shortcuts

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