client

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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(method string, host string, data []byte, headers map[string][]string) chan interfaces.IClientResponse

func (*HTTPClient) Init

func (t *HTTPClient) Init(app interfaces.IService) 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(_ string, topic string, data []byte, headers map[string][]string) chan interfaces.IClientResponse

func (*KafkaClient) Init

func (t *KafkaClient) Init(app interfaces.IService) 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 Response

type Response struct {
	Body       []byte
	Header     map[string][]string
	Err        error
	RetryCount int
}

func (*Response) Error

func (t *Response) Error() error

func (*Response) GetBody

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

func (*Response) GetHeader

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

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