Documentation
¶
Index ¶
- func RequestIDFromCtx(ctx context.Context) (string, bool)
- func RequestLogger(l *logrus.Logger, debugPaths ...string) func(http.Handler) http.Handler
- func SecurityHeaders() func(http.Handler) http.Handler
- func UserIDFromCtx(ctx context.Context) (string, bool)
- func WithUserID(ctx context.Context, uid string) context.Context
- type Config
- type MonitoringConfig
- type PublicCat
- type PublicRecord
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestLogger ¶
RequestLogger logs basic request info.
func SecurityHeaders ¶
SecurityHeaders adds common security-related headers to all responses.
Types ¶
type Config ¶
type Config struct {
Store *storage.Store
Logger *logrus.Logger
Version string
CORSAllowOrigin []string
Monitoring MonitoringConfig
JWTSecret string
AccessTTL time.Duration
RefreshTTL time.Duration
OAuth oauth.Config
BotAPIKey string
SessionStore sessions.SessionStore
DevLoginEnabled bool
SkipWorkers bool
}
type MonitoringConfig ¶
type PublicCat ¶
type PublicCat struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Condition int `json:"condition"`
NeedAttention bool `json:"need_attention"`
Tags []storage.Tag `json:"tags,omitempty"`
LastSeen *time.Time `json:"last_seen,omitempty"`
Locations []storage.CatLocation `json:"locations,omitempty"`
Images []storage.Image `json:"images,omitempty"`
Likes int64 `json:"likes"`
Liked bool `json:"liked"`
CreatedAt time.Time `json:"created_at"`
Records any `json:"records,omitempty"`
}
func ToPublicCat ¶
type PublicRecord ¶
type PublicRecord struct {
ID string `json:"id"`
Type string `json:"type"`
Timestamp time.Time `json:"timestamp"`
DoneAt *time.Time `json:"done_at,omitempty"`
}
func ToPublicRecord ¶
func ToPublicRecord(r storage.Record) PublicRecord
Click to show internal directories.
Click to hide internal directories.