util

package
v0.0.0-...-68f5397 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogger deprecated

func GetLogger() *zap.SugaredLogger

Deprecated: instead calling this method inject logger from wire

func IsErrNoRows

func IsErrNoRows(err error) bool

func NewHttpClient

func NewHttpClient() *http.Client

func NewSugardLogger

func NewSugardLogger() *zap.SugaredLogger

Types

type ApiError

type ApiError struct {
	HttpStatusCode    int         `json:"-"`
	Code              string      `json:"code,omitempty"`
	InternalMessage   string      `json:"internalMessage,omitempty"`
	UserMessage       interface{} `json:"userMessage,omitempty"`
	UserDetailMessage string      `json:"userDetailMessage,omitempty"`
}

func (*ApiError) Error

func (e *ApiError) Error() string

func (*ApiError) ErrorfInternal

func (e *ApiError) ErrorfInternal(format string, a ...interface{}) error

default internal will be set

func (ApiError) ErrorfUser

func (e ApiError) ErrorfUser(format string, a ...interface{}) error

default telemetry message will be set

type PosthogConfig

type PosthogConfig struct {
	PosthogApiKey   string `env:"POSTHOG_API_KEY" envDefault:""`
	PosthogEndpoint string `env:"POSTHOG_ENDPOINT" envDefault:"https://app.posthog.com"`
}

func GetPosthogConfig

func GetPosthogConfig() (*PosthogConfig, error)

Jump to

Keyboard shortcuts

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