Versions in this module Expand all Collapse all v1 v1.0.1 Mar 18, 2025 Changes in this version + const BlueBold + const Green + const Magenta + const Red + const Reset + const Yellow + var Default = New(log.New(os.Stdout, "\r\n", log.LstdFlags), Config{ ... }) + func Get(ctx context.Context, url string, options ...Option) (httpStatusCode int, respBody []byte, err error) + func GetHttpClient() *http.Client + func Post(ctx context.Context, url string, data []byte, options ...Option) (httpStatusCode int, respBody []byte, err error) + func Request(method string, url string, options ...Option) (httpStatusCode int, respBody []byte, err error) + func SetHttpClient(c *http.Client) + type Config struct + Colorful bool + LogLevel LogLevel + type Interface interface + Debug func(context.Context, string, ...interface{}) + Error func(context.Context, string, ...interface{}) + Info func(context.Context, string, ...interface{}) + LogMode func(LogLevel) Interface + Warn func(context.Context, string, ...interface{}) + func New(writer Writer, config Config) Interface + type LogLevel int + const Debug + const Error + const Info + const Silent + const Warn + type Option interface + func WithContext(ctx context.Context) Option + func WithData(data []byte) Option + func WithHeaders(headers map[string]string) Option + func WithLogger(l Interface) Option + func WithSlowThreshold(threshold time.Duration) Option + func WithTimeout(timeout time.Duration) Option + type Writer interface + Printf func(string, ...interface{})