Documentation
¶
Index ¶
- Constants
- func CheckIncident(inc *Incident) (err error)
- func NewArrayFromScannableSource[T any](src IScannableSequence) (values []T, err error)
- func NewNonNullValueFromScannableSource[T any](src IScannable) (T, error)
- func NewValueFromScannableSource[T any](src IScannable) (*T, error)
- type CaptchaAnswer
- type CaptchaId
- type Email
- type FormatStringResource
- type IApplication
- type IPAS
- type IScannable
- type IScannableSequence
- type IServer
- type ISettings
- type Incident
- type IncidentType
- type Module
- type Name
- type Password
- type Path
- type RequestId
- type Resource
- type ResourceType
- type ScheduledFn
- type Scheduler
- type StepNumber
- type SystemEvent
- type SystemEventData
- type SystemEventRequirements
- type SystemEventType
- type UserParameters
- type UserRoles
- type VerificationCode
- type WebTokenString
Constants ¶
View Source
const ( ErrIncidentIsNotSet = "incident is not set" ErrIncidentTypeError = "incident type error" )
View Source
const ( IncidentType_IllegalAccessAttempt = 1 IncidentType_FakeToken = 2 IncidentType_VerificationCodeMismatch = 3 IncidentType_DoubleLogInAttempt = 4 IncidentType_PreSessionHacking = 5 IncidentType_CaptchaAnswerMismatch = 6 IncidentType_PasswordMismatch = 7 IncidentType_PasswordChangeHacking = 8 IncidentType_EmailChangeHacking = 9 IncidentType_FakeIPA = 10 IncidentType_ReadingNotificationOfOtherUsers = 11 IncidentType_WrongDKey = 12 )
View Source
const ( Module_ACM = Module(1) Module_GWM = Module(2) Module_MM = Module(3) Module_NM = Module(4) Module_RCS = Module(5) Module_SM = Module(6) Module_SMTP = Module(7) )
View Source
const ( ResourceType_Text = ResourceType(1) ResourceType_Number = ResourceType(2) ResourceTypeLast = ResourceType_Number )
View Source
const ( ErrSystemEventType = "system event type error" ErrSystemEventParameters = "system event parameters error" )
View Source
const ( SystemEventType_ThreadParentChange = SystemEventType(1) // -> Users subscribed to the thread. SystemEventType_ThreadNameChange = SystemEventType(2) // -> Users subscribed to the thread. SystemEventType_ThreadDeletion = SystemEventType(3) // -> Users subscribed to the thread. SystemEventType_ThreadNewMessage = SystemEventType(4) // -> Users subscribed to the thread. SystemEventType_ThreadMessageEdit = SystemEventType(5) // -> Users subscribed to the thread. SystemEventType_ThreadMessageDeletion = SystemEventType(6) // -> Users subscribed to the thread. SystemEventType_MessageTextEdit = SystemEventType(7) // -> Author of the message. SystemEventType_MessageParentChange = SystemEventType(8) // -> Author of the message. SystemEventType_MessageDeletion = SystemEventType(9) // -> Author of the message. SystemEventTypeLast = SystemEventType_MessageDeletion )
View Source
const (
CookieName_Token = "token"
)
View Source
const (
ErrUnexpectedNull = "unexpected null"
)
View Source
const (
IncidentTypesCount = 12
)
Variables ¶
This section is empty.
Functions ¶
func CheckIncident ¶ added in v0.0.39
func NewArrayFromScannableSource ¶
func NewArrayFromScannableSource[T any](src IScannableSequence) (values []T, err error)
func NewNonNullValueFromScannableSource ¶ added in v0.0.39
func NewNonNullValueFromScannableSource[T any](src IScannable) (T, error)
func NewValueFromScannableSource ¶
func NewValueFromScannableSource[T any](src IScannable) (*T, error)
Types ¶
type CaptchaAnswer ¶ added in v0.0.54
type FormatStringResource ¶ added in v0.0.62
type FormatStringResource struct { Id cmb.Id `json:"id"` Type ResourceType `json:"type"` FSType *cmb.Text `json:"fsType"` Text *cmb.Text `json:"text"` ToC time.Time `json:"toc"` }
FormatStringResource is a format string as a resource. This model is used for interaction with database.
func NewFormatStringResource ¶ added in v0.0.62
func NewFormatStringResource() (fs *FormatStringResource)
func NewFormatStringResourceFromScannableSource ¶ added in v0.0.62
func NewFormatStringResourceFromScannableSource(src IScannable) (fsr *FormatStringResource, err error)
type IApplication ¶
type IApplication interface {
Use() error
}
type IScannable ¶
type IScannableSequence ¶
type IScannableSequence interface { IScannable Next() bool // = HasNextValue() }
type IncidentType ¶ added in v0.0.39
type IncidentType byte
func (IncidentType) IsValid ¶ added in v0.0.39
func (it IncidentType) IsValid() (ok bool)
type Path ¶ added in v0.0.54
func NormalisePath ¶ added in v0.0.8
type Resource ¶ added in v0.0.61
type Resource struct { Id cmb.Id `json:"id"` Type ResourceType `json:"type"` Text *cmb.Text `json:"text"` Number *cmb.Count `json:"number"` ToC time.Time `json:"toc"` }
func NewResource ¶ added in v0.0.61
func NewResource() (r *Resource)
func NewResourceFromNumber ¶ added in v0.0.61
func NewResourceFromScannableSource ¶ added in v0.0.61
func NewResourceFromScannableSource(src IScannable) (r *Resource, err error)
func NewResourceFromText ¶ added in v0.0.61
func NewResourceFromValue ¶ added in v0.0.61
type ResourceType ¶ added in v0.0.61
type ResourceType byte
func (ResourceType) AsByte ¶ added in v0.0.61
func (rt ResourceType) AsByte() byte
func (ResourceType) IsValid ¶ added in v0.0.61
func (rt ResourceType) IsValid() bool
func (*ResourceType) Scan ¶ added in v0.0.61
func (rt *ResourceType) Scan(src any) (err error)
func (ResourceType) ToString ¶ added in v0.0.61
func (rt ResourceType) ToString() string
type ScheduledFn ¶ added in v0.0.40
type ScheduledFn = func() error
type Scheduler ¶ added in v0.0.40
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶ added in v0.0.40
func NewScheduler(srv IServer, funcs60 []ScheduledFn, funcs600 []ScheduledFn, funcs3600 []ScheduledFn) (s *Scheduler)
type StepNumber ¶ added in v0.0.54
type SystemEvent ¶ added in v0.0.59
type SystemEvent struct { SystemEventData // ID and time of the event are automatically set by database and should // not be touched manually. Id cmb.Id `json:"id"` Time time.Time `json:"time"` }
func NewSystemEvent ¶ added in v0.0.59
func NewSystemEvent() (se *SystemEvent)
func NewSystemEventArrayFromRows ¶ added in v0.0.59
func NewSystemEventArrayFromRows(rows *sql.Rows) (ses []SystemEvent, err error)
func NewSystemEventFromScannableSource ¶ added in v0.0.59
func NewSystemEventFromScannableSource(src IScannable) (se *SystemEvent, err error)
func NewSystemEventWithData ¶ added in v0.0.60
func NewSystemEventWithData(data SystemEventData) (se *SystemEvent, err error)
type SystemEventData ¶ added in v0.0.60
type SystemEventData struct { // Event type. This field is required. All other fields are optional. // The number and values of other fields depend on the event type. Type SystemEventType `json:"type"` // ID of the thread mentioned in the event. // E.g., if a thread was renamed, it's ID is this field. ThreadId *cmb.Id `json:"threadId"` // ID of the message mentioned in the event. // E.g., if a message was added into a thread, it's ID is this field. MessageId *cmb.Id `json:"messageId"` // ID of the user mentioned in the event. // E.g., if a user has changed name of a thread, it's ID is this field. UserId *cmb.Id `json:"userId"` // ID of a user who initially created the object. // Some events deal with two UserId's, where one is the ID of the original // creator of the object and another is the user who modified the object. // In such cases, the original creator of the object is stored in the // 'Creator' field and the user who modified the object is stored in the // 'UserId' field. In cases where only a single user is important, this // field is not used, as this only user is stored in the 'UserId' field. Creator *cmb.Id `json:"creator,omitempty"` }
SystemEventData is a set of parameters of a system event.
func (*SystemEventData) CheckParameters ¶ added in v0.0.60
func (sed *SystemEventData) CheckParameters() (ok bool, err error)
func (*SystemEventData) CheckType ¶ added in v0.0.60
func (sed *SystemEventData) CheckType() (ok bool, err error)
type SystemEventRequirements ¶ added in v0.0.60
type SystemEventRequirements struct { IsThreadIdRequired bool IsMessageIdRequired bool IsUserIdRequired bool IsCreatorRequired bool }
SystemEventRequirements store requirements for system event data. Different event types require different sets of parameters.
type SystemEventType ¶ added in v0.0.59
type SystemEventType byte
func (SystemEventType) AsByte ¶ added in v0.0.59
func (set SystemEventType) AsByte() byte
func (SystemEventType) IsValid ¶ added in v0.0.59
func (set SystemEventType) IsValid() bool
func (*SystemEventType) Scan ¶ added in v0.0.59
func (set *SystemEventType) Scan(src any) (err error)
func (SystemEventType) ToString ¶ added in v0.0.59
func (set SystemEventType) ToString() string
type UserParameters ¶
type UserParameters struct { Id cmb.Id `json:"id"` PreRegTime *time.Time `json:"preRegTime,omitempty"` Email Email `json:"email,omitempty"` Name Name `json:"name,omitempty"` ApprovalTime *time.Time `json:"approvalTime,omitempty"` RegTime *time.Time `json:"regTime,omitempty"` Roles *UserRoles `json:"roles,omitempty"` LastBadLogInTime *time.Time `json:"lastBadLogInTime,omitempty"` BanTime *time.Time `json:"banTime,omitempty"` LastBadActionTime *time.Time `json:"lastBadActionTime,omitempty"` }
func NewUserParameters ¶
func NewUserParameters() (up *UserParameters)
func NewUserParametersFromScannableSource ¶
func NewUserParametersFromScannableSource(src IScannable) (up *UserParameters, err error)
type UserRoles ¶
type UserRoles struct { IsAdministrator cmb.Flag `json:"isAdministrator"` IsModerator cmb.Flag `json:"isModerator"` IsAuthor cmb.Flag `json:"isAuthor"` IsWriter cmb.Flag `json:"isWriter"` IsReader cmb.Flag `json:"isReader"` CanLogIn cmb.Flag `json:"canLogIn"` }
func NewUserRoles ¶
func NewUserRoles() (ur *UserRoles)
func NewUserRolesFromScannableSource ¶
func NewUserRolesFromScannableSource(src IScannable) (ur *UserRoles, err error)
type VerificationCode ¶ added in v0.0.54
type WebTokenString ¶ added in v0.0.54
Source Files
¶
- CaptchaAnswer.go
- CaptchaId.go
- Email.go
- FormatStringResource.go
- IApplication.go
- IPAS.go
- IScannable.go
- IScannableSequence.go
- IServer.go
- ISettings.go
- Incident.go
- IncidentType.go
- Module.go
- Name.go
- Password.go
- Path.go
- RequestId.go
- Resource.go
- ResourceType.go
- ScheduledFn.go
- Scheduler.go
- StepNumber.go
- SystemEvent.go
- SystemEventData.go
- SystemEventRequirements.go
- SystemEventType.go
- UserParameters.go
- UserRoles.go
- VerificationCode.go
- WebTokenString.go
- sql.go
- token.go
Click to show internal directories.
Click to hide internal directories.