core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Logger     LoggerInterface
	HttpClient *http.Client
}

func (*Builder) GetInstance

func (b *Builder) GetInstance() *Client

func (*Builder) WithHttpClient

func (b *Builder) WithHttpClient(pClient *http.Client) *Builder

func (*Builder) WithLogger

func (b *Builder) WithLogger(loggerInterface LoggerInterface) *Builder

type Client

type Client struct {
	HttpClient *http.Client
	Logger     LoggerInterface
}

func NewClient

func NewClient() *Client

func (*Client) Get

func (c *Client) Get(requestUrl string) (int, []byte, error)

Get performs a GET request to the specified URL and returns the response body as a byte array.

type CoreInterface

type CoreInterface interface {
	Get(requestUrl string) (int, []byte, error)
}

type Factory

type Factory struct {
	Builder *Builder
}

func NewFactory

func NewFactory() *Factory

func NewFactoryWithBuilder

func NewFactoryWithBuilder(pBuilder *Builder) *Factory

func (*Factory) CreateClient

func (f *Factory) CreateClient() *Client

func (*Factory) CreateWithHttpClient

func (f *Factory) CreateWithHttpClient(pClient *http.Client) *Client

func (*Factory) CreateWithLogger

func (f *Factory) CreateWithLogger(logger LoggerInterface) *Client

func (*Factory) CreateWithLoggerAndHttpClient

func (f *Factory) CreateWithLoggerAndHttpClient(loggerInterface LoggerInterface, pClient *http.Client) *Client

type LoggerInterface

type LoggerInterface interface {
	Info(msg string, fields ...zapcore.Field)
	Error(msg string, fields ...zapcore.Field)
}

Jump to

Keyboard shortcuts

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