Versions in this module Expand all Collapse all v0 v0.0.3 Mar 8, 2024 v0.0.2 Mar 4, 2024 Changes in this version + var ErrNetwork = errors.New("network error") + func NetworkStatus() (bool, error) + type EmptyRequestBodyError struct + Method string + func (e *EmptyRequestBodyError) Error() string + type HTTPCli struct + func NewHTTPClient() *HTTPCli + func (c *HTTPCli) EncodeJSONBody(body interface{}) (*bytes.Buffer, error) + func (c *HTTPCli) Get(ctx context.Context, urll string, params map[string]string, ...) error + func (c *HTTPCli) GetImage(ctx context.Context, imgURL string, options ...HTTPOption) ([]byte, error) + func (c *HTTPCli) Post(ctx context.Context, urll string, reqbody interface{}, respbody interface{}, ...) error + func (c *HTTPCli) PostSSE(ctx context.Context, urll string, reqbody interface{}, options ...HTTPOption) (chan string, error) + type HTTPOption func(c *HTTPCli) + func WithHeader(header HeaderMap) HTTPOption + func WithStream() HTTPOption + func WithTimeout(timeout time.Duration) HTTPOption + func WithTokenHeaderOption(token string) HTTPOption + type HTTPRequestError struct + Cause error + Code int + Message string + func (e *HTTPRequestError) Error() string + type HeaderMap map[string]string + type IHttpClient interface + Get func(ctx context.Context, urll string, params map[string]string, resp interface{}, ...) error + GetImage func(ctx context.Context, imgURL string, options ...HTTPOption) ([]byte, error) + Post func(ctx context.Context, urll string, reqbody interface{}, resp interface{}, ...) error + PostSSE func(ctx context.Context, urll string, reqbody interface{}, options ...HTTPOption) (chan string, error) + type IWsClient interface + CloseClient func() error + ConnClient func(req interface{}) error + ResultChans func(wsmsg <-chan WsMessage, err <-chan error) + SendBinaryDates func(data []byte) + type MockIHttpClient struct + func NewMockIHttpClient(ctrl *gomock.Controller) *MockIHttpClient + func (m *MockIHttpClient) EXPECT() *MockIHttpClientMockRecorder + func (m *MockIHttpClient) Get(arg0 context.Context, arg1 string, arg2 map[string]string, arg3 any, ...) error + func (m *MockIHttpClient) GetImage(arg0 context.Context, arg1 string, arg2 ...HTTPOption) ([]byte, error) + func (m *MockIHttpClient) Post(arg0 context.Context, arg1 string, arg2, arg3 any, arg4 ...HTTPOption) error + func (m *MockIHttpClient) PostSSE(arg0 context.Context, arg1 string, arg2 any, arg3 ...HTTPOption) (chan string, error) + type MockIHttpClientMockRecorder struct + func (mr *MockIHttpClientMockRecorder) Get(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call + func (mr *MockIHttpClientMockRecorder) GetImage(arg0, arg1 any, arg2 ...any) *gomock.Call + func (mr *MockIHttpClientMockRecorder) Post(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call + func (mr *MockIHttpClientMockRecorder) PostSSE(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call + type WrapMessageError struct + Cause error + Message string + func (e *WrapMessageError) Error() string + type WsClient struct + Conn *websocket.Conn + Headers http.Header + URL string + func NewWsClient(url string, headers http.Header) *WsClient + func (c *WsClient) CloseClient() error + func (c *WsClient) ConnClient(req interface{}) error + func (c *WsClient) ResultChans() (<-chan WsMessage, <-chan error) + func (c *WsClient) SendBinaryDates(data []byte) + type WsMessage struct + Data []byte + Type int