Documentation ¶
Index ¶
- func DeviceID(ctx context.Context) (string, error)
- func ForwardedFor(ctx context.Context) (string, []string, error)
- func GetLogger(ctx context.Context) *zap.Logger
- func RequestID(ctx context.Context) (string, error)
- func SessionID(ctx context.Context) (string, error)
- func Set(ctx context.Context, s *Settings) context.Context
- func SetLogger(ctx context.Context, l *zap.Logger) context.Context
- func SetRequestMetaData(ctx context.Context, s *RequestMetaData) context.Context
- func UserAgent(ctx context.Context) (string, error)
- type ApiConfig
- type DebugConfig
- type PostgresConfig
- type PrometheusConfig
- type Reloader
- type RequestMetaData
- type SentryConfig
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForwardedFor ¶
ForwardedFor returns real IP and proxy IPs from context gRPC MetaData.
func SetRequestMetaData ¶
func SetRequestMetaData(ctx context.Context, s *RequestMetaData) context.Context
SetRequestMetaData returns a new context with set RequestMetaData.
Types ¶
type DebugConfig ¶
type PostgresConfig ¶
type PrometheusConfig ¶
type Reloader ¶
type Reloader struct {
// contains filtered or unexported fields
}
Reloader provides current application configuration for other packages.
It reloads settings from Consul.
func ConnectAndRunReloader ¶
func (*Reloader) PutSettings ¶
PutSettings stores given settings in Consul.
type RequestMetaData ¶
type RequestMetaData struct { SessionID string RequestID string DeviceID string RealIP string ProxyIPs []string UserAgent string }
func GetRequestMetaData ¶
func GetRequestMetaData(ctx context.Context) *RequestMetaData
GetRequestMetaData returns RequestMetaData from the context.
func ParseRequestMetaData ¶
func ParseRequestMetaData(ctx context.Context) (md *RequestMetaData, err error)
ParseRequestMetaData returns request meta data from context MetaData gRPC.
type SentryConfig ¶
type SentryConfig struct {
DSN string `json:"dsn"`
}
type Settings ¶
type Settings struct { Postgres PostgresConfig `json:"postgres"` API ApiConfig `json:"api"` Debug DebugConfig `json:"debug"` Sentry SentryConfig `json:"sentry"` Prometheus PrometheusConfig `json:"prometheus_config"` }
Click to show internal directories.
Click to hide internal directories.