api_service

package
v0.0.0-...-978cf5a Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUser

func CheckUser(context context.Context, req *demoapi.CheckUserRequest, reqOpt ...config.RequestOption) (resp *demoapi.CheckUserResponse, rawResponse *protocol.Response, err error)

func ConfigDefaultClient

func ConfigDefaultClient(ops ...Option) (err error)

func CreateNote

func CreateNote(context context.Context, req *demoapi.CreateNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.CreateNoteResponse, rawResponse *protocol.Response, err error)

func CreateUser

func CreateUser(context context.Context, req *demoapi.CreateUserRequest, reqOpt ...config.RequestOption) (resp *demoapi.CreateUserResponse, rawResponse *protocol.Response, err error)

func DeleteNote

func DeleteNote(context context.Context, req *demoapi.DeleteNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.DeleteNoteResponse, rawResponse *protocol.Response, err error)

func QueryNote

func QueryNote(context context.Context, req *demoapi.QueryNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.QueryNoteResponse, rawResponse *protocol.Response, err error)

func UpdateNote

func UpdateNote(context context.Context, req *demoapi.UpdateNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.UpdateNoteResponse, rawResponse *protocol.Response, err error)

Types

type ApiServiceClient

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

func (*ApiServiceClient) CheckUser

func (s *ApiServiceClient) CheckUser(context context.Context, req *demoapi.CheckUserRequest, reqOpt ...config.RequestOption) (resp *demoapi.CheckUserResponse, rawResponse *protocol.Response, err error)

func (*ApiServiceClient) CreateNote

func (s *ApiServiceClient) CreateNote(context context.Context, req *demoapi.CreateNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.CreateNoteResponse, rawResponse *protocol.Response, err error)

func (*ApiServiceClient) CreateUser

func (s *ApiServiceClient) CreateUser(context context.Context, req *demoapi.CreateUserRequest, reqOpt ...config.RequestOption) (resp *demoapi.CreateUserResponse, rawResponse *protocol.Response, err error)

func (*ApiServiceClient) DeleteNote

func (s *ApiServiceClient) DeleteNote(context context.Context, req *demoapi.DeleteNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.DeleteNoteResponse, rawResponse *protocol.Response, err error)

func (*ApiServiceClient) QueryNote

func (s *ApiServiceClient) QueryNote(context context.Context, req *demoapi.QueryNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.QueryNoteResponse, rawResponse *protocol.Response, err error)

func (*ApiServiceClient) UpdateNote

func (s *ApiServiceClient) UpdateNote(context context.Context, req *demoapi.UpdateNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.UpdateNoteResponse, rawResponse *protocol.Response, err error)

type Client

type Client interface {
	CreateUser(context context.Context, req *demoapi.CreateUserRequest, reqOpt ...config.RequestOption) (resp *demoapi.CreateUserResponse, rawResponse *protocol.Response, err error)

	CheckUser(context context.Context, req *demoapi.CheckUserRequest, reqOpt ...config.RequestOption) (resp *demoapi.CheckUserResponse, rawResponse *protocol.Response, err error)

	CreateNote(context context.Context, req *demoapi.CreateNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.CreateNoteResponse, rawResponse *protocol.Response, err error)

	QueryNote(context context.Context, req *demoapi.QueryNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.QueryNoteResponse, rawResponse *protocol.Response, err error)

	UpdateNote(context context.Context, req *demoapi.UpdateNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.UpdateNoteResponse, rawResponse *protocol.Response, err error)

	DeleteNote(context context.Context, req *demoapi.DeleteNoteRequest, reqOpt ...config.RequestOption) (resp *demoapi.DeleteNoteResponse, rawResponse *protocol.Response, err error)
}

func NewApiServiceClient

func NewApiServiceClient(hostUrl string, ops ...Option) (Client, error)

type Option

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

Configuration of client

func WithHeader

func WithHeader(header http.Header) Option

WithHeader is used to add the default header, which is carried by every request

func WithHertzClient

func WithHertzClient(client client.Doer) Option

WithHertzClient is used to register a custom hertz client

func WithHertzClientMiddleware

func WithHertzClientMiddleware(mws ...hertz_client.Middleware) Option

WithHertzClientMiddleware is used to register the middleware for the hertz client

func WithHertzClientOption

func WithHertzClientOption(opt ...config.ClientOption) Option

WithHertzClientOption is used to pass configuration for the hertz client

func WithResponseResultDecider

func WithResponseResultDecider(decider ResponseResultDecider) Option

WithResponseResultDecider configure custom deserialization of http response to response struct

type Options

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

type ResponseResultDecider

type ResponseResultDecider func(statusCode int, rawResponse *protocol.Response) (isError bool)

Definition of global data and types.

Jump to

Keyboard shortcuts

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