Documentation ¶
Index ¶
- func GetRoutes(s IEchoService) []api2.Route
- type Client
- func (c *Client) Close() error
- func (c *Client) Echo(ctx context.Context, req *EchoRequest) (res *EchoResponse, err error)
- func (c *Client) Hello(ctx context.Context, req *HelloRequest) (res *HelloResponse, err error)
- func (c *Client) Raw(ctx context.Context, req *RawRequest) (res *RawResponse, err error)
- func (c *Client) Redirect(ctx context.Context, req *RedirectRequest) (res *RedirectResponse, err error)
- func (c *Client) Since(ctx context.Context, req *SinceRequest) (res *SinceResponse, err error)
- func (c *Client) Stream(ctx context.Context, req *StreamRequest) (res *StreamResponse, err error)
- type CustomType
- type CustomType2
- type Direction
- type EchoRepository
- type EchoRequest
- type EchoResponse
- type EchoService
- func (s *EchoService) Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error)
- func (s *EchoService) Hello(ctx context.Context, req *HelloRequest) (*HelloResponse, error)
- func (s *EchoService) Raw(ctx context.Context, req *RawRequest) (*RawResponse, error)
- func (s *EchoService) Redirect(ctx context.Context, req *RedirectRequest) (*RedirectResponse, error)
- func (s *EchoService) Since(ctx context.Context, req *SinceRequest) (*SinceResponse, error)
- func (s *EchoService) Stream(ctx context.Context, req *StreamRequest) (*StreamResponse, error)
- type HelloRequest
- type HelloResponse
- type IEchoService
- type OpCode
- type RawRequest
- type RawResponse
- type RedirectRequest
- type RedirectResponse
- type Result
- type SinceRequest
- type SinceResponse
- type StreamRequest
- type StreamResponse
- type UserSettings
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 (*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)
func (*Client) Raw ¶ added in v0.2.10
func (c *Client) Raw(ctx context.Context, req *RawRequest) (res *RawResponse, err error)
func (*Client) Redirect ¶ added in v0.2.4
func (c *Client) Redirect(ctx context.Context, req *RedirectRequest) (res *RedirectResponse, err error)
func (*Client) Since ¶
func (c *Client) Since(ctx context.Context, req *SinceRequest) (res *SinceResponse, err error)
func (*Client) Stream ¶ added in v0.2.1
func (c *Client) Stream(ctx context.Context, req *StreamRequest) (res *StreamResponse, err error)
type CustomType ¶
type CustomType struct { Hell int UserSettings }
type CustomType2 ¶
type CustomType2 struct { Hell int *UserSettings }
type EchoRepository ¶
type EchoRepository struct { }
func NewEchoRepository ¶
func NewEchoRepository() *EchoRepository
func (*EchoRepository) Generate ¶
func (s *EchoRepository) Generate() (*Result, error)
type EchoRequest ¶
type EchoRequest struct { User string `url:"user"` Session string `header:"session"` Text string `json:"text"` Bar time.Duration `json:"bar"` Code OpCode `json:"code"` Dir Direction `json:"dir"` Items []CustomType2 `json:"items"` Maps map[string]Direction `json:"maps"` // contains filtered or unexported fields }
type EchoResponse ¶
type EchoResponse struct { Text string `json:"text"` // field comment. Old string `json:"old"` // Deprecated! Use field Text. Old2 string `json:"old2"` // The field is DEPRECATED! }
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)
func (*EchoService) Raw ¶ added in v0.2.10
func (s *EchoService) Raw(ctx context.Context, req *RawRequest) (*RawResponse, error)
func (*EchoService) Redirect ¶ added in v0.2.4
func (s *EchoService) Redirect(ctx context.Context, req *RedirectRequest) (*RedirectResponse, error)
func (*EchoService) Since ¶
func (s *EchoService) Since(ctx context.Context, req *SinceRequest) (*SinceResponse, error)
func (*EchoService) Stream ¶ added in v0.2.1
func (s *EchoService) Stream(ctx context.Context, req *StreamRequest) (*StreamResponse, 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) Since(ctx context.Context, req *SinceRequest) (*SinceResponse, error) Stream(ctx context.Context, req *StreamRequest) (*StreamResponse, error) Redirect(ctx context.Context, req *RedirectRequest) (*RedirectResponse, error) Raw(ctx context.Context, req *RawRequest) (*RawResponse, error) }
type RawRequest ¶ added in v0.2.10
type RawRequest struct {
Token []byte `use_as_body:"true" is_raw:"true"`
}
type RawResponse ¶ added in v0.2.10
type RawResponse struct {
Token []byte `use_as_body:"true" is_raw:"true"`
}
type RedirectRequest ¶ added in v0.2.4
type RedirectRequest struct {
ID string `query:"id"`
}
type RedirectResponse ¶ added in v0.2.4
type SinceRequest ¶
type SinceRequest struct { Session string `header:"session"` Body *timestamppb.Timestamp `use_as_body:"true" is_protobuf:"true"` }
type SinceResponse ¶
type SinceResponse struct {
Body *durationpb.Duration `use_as_body:"true" is_protobuf:"true"`
}
type StreamRequest ¶ added in v0.2.1
type StreamRequest struct { Session string `header:"session"` Body io.ReadCloser `use_as_body:"true" is_stream:"true"` }
type StreamResponse ¶ added in v0.2.1
type StreamResponse struct {
Body io.ReadCloser `use_as_body:"true" is_stream:"true"`
}
type UserSettings ¶
type UserSettings map[string]interface{}
Click to show internal directories.
Click to hide internal directories.