client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(options ...Option) *Client

func (*Client) StartListen

func (c *Client) StartListen()

func (*Client) Submit

func (c *Client) Submit(submitUri string, params map[string]string, l Listener) error

type GetClientAddress added in v0.0.4

type GetClientAddress func() string // http://ip:port

type GetServerAddress

type GetServerAddress func() string // http://ip:port

可用于负载均衡

type Listener

type Listener interface {
	Listen(reqId string, submitUri string, response string, serverError error) error
}

type ListenerAsynFunc

type ListenerAsynFunc func(reqId string, submitUri string, response string, serverError error) error

func (ListenerAsynFunc) Listen

func (f ListenerAsynFunc) Listen(reqId string, submitUri string, response string, serverError error) error

type ListenerFunc

type ListenerFunc func(reqId string, submitUri string, response string, serverError error) error

func (ListenerFunc) Listen

func (f ListenerFunc) Listen(reqId string, submitUri string, response string, serverError error) error

type Option

type Option func(c *Client)

func WithEngine added in v0.0.2

func WithEngine(engine *gin.Engine) Option

func WithGetClientAddress added in v0.0.4

func WithGetClientAddress(getClientAddress GetClientAddress) Option

func WithGetServerAddress

func WithGetServerAddress(getServerAddress GetServerAddress) Option

func WithListenUri

func WithListenUri(listenUri string) Option

func WithLogger

func WithLogger(logger *logrus.Logger) Option

type SubmitResult

type SubmitResult struct {
	Result   string `json:"result"`
	Complete string `json:"complete"`
	Response string `json:"response"`
}

Jump to

Keyboard shortcuts

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