example

package
v0.0.0-...-207416a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRoutes

func GetRoutes(s IEchoService) []api2.Route

Types

type Client

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

func NewClient

func NewClient(baseURL string) *Client

func (*Client) Echo

func (c *Client) Echo(ctx context.Context, req *EchoRequest) (res *EchoResponse, err error)

func (*Client) Hello

func (c *Client) Hello(ctx context.Context, req *HelloRequest) (res *HelloResponse, err error)

type CustomType

type CustomType struct {
	Hell int
}

type EchoRepository

type EchoRepository struct {
}

func NewEchoRepository

func NewEchoRepository() *EchoRepository

func (*EchoRepository) Generate

func (s *EchoRepository) Generate() (*Result, error)

type EchoRequest

type EchoRequest struct {
	Session string `header:"session"`
	Text    string `json:"text"`
}

type EchoResponse

type EchoResponse struct {
	Text string `json:"text"` // field comment.
}

EchoResponse.

type EchoService

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

func NewEchoService

func NewEchoService(repo *EchoRepository) *EchoService

func (*EchoService) Echo

func (s *EchoService) Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error)

func (*EchoService) Hello

func (s *EchoService) Hello(ctx context.Context, req *HelloRequest) (*HelloResponse, error)

type HelloRequest

type HelloRequest struct {
	Key string `query:"key"`
}

type HelloResponse

type HelloResponse struct {
	Session string `header:"session"`
}

type IEchoService

type IEchoService interface {
	Hello(ctx context.Context, req *HelloRequest) (*HelloResponse, error)
	Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error)
}

type Result

type Result struct {
	Data string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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