Documentation ¶
Index ¶
Constants ¶
View Source
const LogAllowedTimeDrift = 5 * time.Minute
LogAllowedTimeDrift is the maximum amount of time that the Log.CreatedAt value can be in the future relative to the current system clock. A low value is recommended to prevent future dates from being accepted for insertion into the db
View Source
const LogIDChars = "0123456789abcdef"
LogIDChars calculation: https://zelark.github.io/nano-id-cc/
View Source
const LogIDLength = 24
LogIDLength calculation: https://zelark.github.io/nano-id-cc/
View Source
const LogMaxMessageLength = 4 * 1024
View Source
const LogMaxModuleLength = 64
View Source
const LogMaxServiceLength = 64
Variables ¶
View Source
var LogLevels = map[Level]int{ LevelFatal: 6, LevelError: 5, LevelWarn: 4, LevelInfo: 3, LevelDebug: 2, LevelTrace: 1, }
Functions ¶
This section is empty.
Types ¶
type Duration ¶
func (Duration) MarshalBSONValue ¶
func (Duration) MarshalJSON ¶
func (*Duration) UnmarshalBSONValue ¶
func (*Duration) UnmarshalJSON ¶
type Log ¶
type Log struct { ID string `json:"id,omitempty" bson:"_id"` Level Level `json:"level,omitempty" bson:"level"` Service string `json:"service,omitempty" bson:"service"` Module string `json:"module,omitempty" bson:"module"` Message string `json:"message,omitempty" bson:"message"` CreatedAt Time `json:"created_at,omitempty" bson:"created_at"` }
type Response ¶
type Response[T any] struct { Success bool `json:"success"` Message string `json:"message,omitempty"` Data *T `json:"data,omitempty"` }
func NewErrorNil ¶
func NewSuccess ¶
func NewSuccessNil ¶
type Time ¶
func (Time) MarshalJSON ¶
func (*Time) UnmarshalBSONValue ¶
func (*Time) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.