Documentation ¶
Index ¶
- func AddOneItem[T any](r *http.Request, cache *core.Cache, model *T)
- func DeleteOneItem[T any](r *http.Request, cache *core.Cache, model *T)
- func GetAllItems[T any](r *http.Request, cache *core.Cache, model T, subsystem string)
- func GetOneItem[T any](r *http.Request, cache *core.Cache, model T, subsystem string)
- func UnmarshalRequestData[T any](r *http.Request, model *T) error
- func UpdateOneItem[T any](r *http.Request, cache *core.Cache, model *T)
- type Logger
- type Response
- type ServiceOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllItems ¶
func GetOneItem ¶
Types ¶
type Logger ¶
type Logger struct { // CallerID is a nickname of the user calling the API. CallerID string `json:"caller_id" validation:"required"` // Code integer is a HTTP return code. Code int `json:"code" validation:"required"` // IPAddress string is basically an user's IPv4/IPv6 address (beware of proxies). IPAddress string `json:"ip_address"` // Message string holds a custom message returned by a various HTTP handler. Message string `json:"message" validation:"required"` // Method string hold a HTTP method name. Method string `json:"method"` // Route string is the very route called by user. Route string `json:"route"` // Time property hold the actual time of the request processing. Time time.Time `json:"time" validation:"required"` // Version is the tagged version of the client's SW (compiled in). Version string `json:"version"` // WorkerName string is the name of a worker processing such request. WorkerName string `json:"worker_name" validation:"required"` }
type Response ¶
type Response struct { AuthGranted bool `json:"auth_granted" default:false` Code int `json:"code"` PublicKey string `json:"public_key,omitempty"` Key string `json:"key,omitempty"` Message string `json:"message"` Count int `json:"count,omitempty"` Subscription struct { Replies bool `json:"replies"` Mentions bool `json:"mentions"` } `json:"subscription,omitempty"` Devices []models.Device `json:"devices,omitempty"` Polls map[string]models.Poll `json:"polls,omitempty"` Posts map[string]models.Post `json:"posts,omitempty"` Users map[string]models.User `json:"users,omitempty"` FlowList []string `json:"flow_records,omitempty"` Data []byte `json:"data,omitempty"` // very stats properties FlowStats map[string]int `json:"flow_stats,omitempty"` UserStats map[string]models.UserStat `json:"user_stats,omitempty"` // auth tokens (JWT) AccessToken string `json:"access_token,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` }
Click to show internal directories.
Click to hide internal directories.