client

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcClient added in v0.3.0

type GrpcClient struct {
	Name   string
	Config GrpcClientConfig
	// contains filtered or unexported fields
}

func NewGrpcClient added in v0.3.0

func NewGrpcClient(name string, cfg GrpcClientConfig) *GrpcClient

func (*GrpcClient) GetClient added in v0.3.0

func (t *GrpcClient) GetClient() *grpc.ClientConn

func (*GrpcClient) Init added in v0.3.0

func (t *GrpcClient) Init(app interfaces.IEngine) error

func (*GrpcClient) Stop added in v0.3.0

func (t *GrpcClient) Stop() error

func (*GrpcClient) String added in v0.3.0

func (t *GrpcClient) String() string

type GrpcClientConfig added in v0.3.0

type GrpcClientConfig struct {
	Url string `yaml:"url"`
}

type HTTPClient

type HTTPClient struct {
	Name   string
	Config HTTPClientConfig
	// contains filtered or unexported fields
}

func NewHTTPClient

func NewHTTPClient(name string, cfg HTTPClientConfig) *HTTPClient

func (*HTTPClient) Fetch

func (t *HTTPClient) Fetch(ctx context.Context, method string, host string, data []byte, headers map[string][]string) chan interfaces.IClientResponse

func (*HTTPClient) Init

func (t *HTTPClient) Init(app interfaces.IEngine) error

func (*HTTPClient) Stop

func (t *HTTPClient) Stop() error

func (*HTTPClient) String

func (t *HTTPClient) String() string

type HTTPClientConfig

type HTTPClientConfig struct {
	RetryCount int `yaml:"retry_count"`
}

type KafkaClient

type KafkaClient struct {
	Name   string
	Config KafkaClientConfig
	// contains filtered or unexported fields
}

func NewKafkaClient

func NewKafkaClient(name string, cfg KafkaClientConfig) *KafkaClient

func (*KafkaClient) Fetch

func (t *KafkaClient) Fetch(ctx context.Context, _ string, topic string, data []byte, headers map[string][]string) chan interfaces.IClientResponse

func (*KafkaClient) Init

func (t *KafkaClient) Init(app interfaces.IEngine) error

func (*KafkaClient) Stop

func (t *KafkaClient) Stop() error

func (*KafkaClient) String

func (t *KafkaClient) String() string

type KafkaClientConfig

type KafkaClientConfig struct {
	Hosts      string `yaml:"hosts"`
	Username   string `yaml:"username"`
	Password   string `yaml:"password"`
	RetryCount int    `yaml:"retry_count"`
}

type Mock added in v0.3.0

type Mock struct {
	Name string
}

func (*Mock) Init added in v0.3.0

func (t *Mock) Init(_ interfaces.IEngine) error

func (*Mock) Stop added in v0.3.0

func (t *Mock) Stop() error

func (*Mock) String added in v0.3.0

func (t *Mock) String() string

type Response

type Response struct {
	Body       io.Reader
	Header     map[string][]string
	Err        error
	RetryCount int
}

func (*Response) Error

func (t *Response) Error() error

func (*Response) GetBody

func (t *Response) GetBody() ([]byte, error)

func (*Response) GetHeader

func (t *Response) GetHeader() map[string][]string

func (*Response) GetLazyBody added in v0.4.1

func (t *Response) GetLazyBody() io.Reader

func (*Response) GetRetries

func (t *Response) GetRetries() int

Jump to

Keyboard shortcuts

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