Documentation
¶
Overview ¶
Package models contains the database models
Index ¶
- type Acl
- type Adminlog
- type Ban
- type Channel
- type Channellog
- type Complaint
- type ComplaintType
- type ComplaintsReference
- type ComplaintsThread
- type Count
- type CreatePendingUserParams
- type CreateUserParams
- type DBTX
- type DefaultMsg
- type DeletionTransaction
- type Domain
- type FraudList
- type FraudListDatum
- type GetUserByIDRow
- type GetUserChannelsRow
- type Gline
- type Help
- type IpRestrict
- type Language
- type Lastrequest
- type Level
- type Lock
- type Noreg
- type Note
- type Notice
- type Objection
- type Pending
- type PendingChanfixScore
- type PendingEmailchange
- type PendingMgrchange
- type PendingPasswordchange
- type PendingPwreset
- type PendingTraffic
- type Pendinguser
- type Querier
- type Queries
- func (q *Queries) CheckEmailExists(ctx context.Context, uemail string) ([]pgtype.Text, error)
- func (q *Queries) CheckUsernameExists(ctx context.Context, username string) ([]string, error)
- func (q *Queries) CreatePendingUser(ctx context.Context, arg CreatePendingUserParams) (pgtype.Text, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeletePendingUserByCookie(ctx context.Context, cookie pgtype.Text) error
- func (q *Queries) GetGlineByIP(ctx context.Context, host string) (Gline, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (q *Queries) GetUserByID(ctx context.Context, id int32) (GetUserByIDRow, error)
- func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)
- func (q *Queries) GetUserChannels(ctx context.Context, userID int32) ([]GetUserChannelsRow, error)
- func (q *Queries) GetWhiteListByIP(ctx context.Context, ip netip.Addr) (Whitelist, error)
- func (q *Queries) ListPendingUsers(ctx context.Context) ([]Pendinguser, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Service
- func (s *Service) CheckEmailExists(ctx context.Context, uemail string) ([]pgtype.Text, error)
- func (s *Service) CheckUsernameExists(ctx context.Context, username string) ([]string, error)
- func (s *Service) CreatePendingUser(ctx context.Context, arg CreatePendingUserParams) (pgtype.Text, error)
- func (s *Service) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (s *Service) DeletePendingUserByCookie(ctx context.Context, cookie pgtype.Text) error
- func (s *Service) GetGlineByIP(ctx context.Context, ip string) (Gline, error)
- func (s *Service) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (s *Service) GetUserByID(ctx context.Context, id int32) (GetUserByIDRow, error)
- func (s *Service) GetUserByUsername(ctx context.Context, username string) (User, error)
- func (s *Service) GetUserChannels(ctx context.Context, userID int32) ([]GetUserChannelsRow, error)
- func (s *Service) GetWhiteListByIP(ctx context.Context, ip netip.Addr) (Whitelist, error)
- func (s *Service) ListPendingUsers(ctx context.Context) ([]Pendinguser, error)
- type Statistic
- type Supporter
- type Timezone
- type Translation
- type User
- type UserSecHistory
- type Userlog
- type UsersLastseen
- type Variable
- type Webnotice
- type Whitelist
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acl ¶
type Acl struct {
AclID pgtype.Int4 `json:"acl_id"`
UserID int32 `json:"user_id"`
Isstaff int16 `json:"isstaff"`
Flags flags.ACL `json:"flags"`
Xtra int32 `json:"xtra"`
LastUpdated int32 `json:"last_updated"`
LastUpdatedBy int32 `json:"last_updated_by"`
SuspendExpire int32 `json:"suspend_expire"`
SuspendBy int32 `json:"suspend_by"`
Deleted int16 `json:"deleted"`
}
type Ban ¶
type Ban struct {
ID pgtype.Int4 `json:"id"`
ChannelID int32 `json:"channel_id"`
Banmask string `json:"banmask"`
SetBy pgtype.Text `json:"set_by"`
SetTs pgtype.Int4 `json:"set_ts"`
Level pgtype.Int2 `json:"level"`
Expires pgtype.Int4 `json:"expires"`
Reason pgtype.Text `json:"reason"`
LastUpdated int32 `json:"last_updated"`
Deleted pgtype.Int2 `json:"deleted"`
}
type Channel ¶
type Channel struct {
ID int32 `json:"id"`
Name string `json:"name"`
Flags int32 `json:"flags"`
MassDeopPro int16 `json:"mass_deop_pro"`
FloodPro int32 `json:"flood_pro"`
Url pgtype.Text `json:"url"`
Description pgtype.Text `json:"description"`
Comment pgtype.Text `json:"comment"`
Keywords pgtype.Text `json:"keywords"`
RegisteredTs pgtype.Int4 `json:"registered_ts"`
ChannelTs int32 `json:"channel_ts"`
ChannelMode pgtype.Text `json:"channel_mode"`
Userflags pgtype.Int2 `json:"userflags"`
LimitOffset pgtype.Int4 `json:"limit_offset"`
LimitPeriod pgtype.Int4 `json:"limit_period"`
LimitGrace pgtype.Int4 `json:"limit_grace"`
LimitMax pgtype.Int4 `json:"limit_max"`
NoTake pgtype.Int4 `json:"no_take"`
LastUpdated int32 `json:"last_updated"`
Deleted pgtype.Int2 `json:"deleted"`
MaxBans pgtype.Int4 `json:"max_bans"`
Welcome pgtype.Text `json:"welcome"`
}
type Channellog ¶
type Complaint ¶
type Complaint struct {
ID int32 `json:"id"`
FromID int32 `json:"from_id"`
FromEmail string `json:"from_email"`
InrecEmail string `json:"inrec_email"`
ComplaintType int32 `json:"complaint_type"`
ComplaintText string `json:"complaint_text"`
ComplaintLogs string `json:"complaint_logs"`
ComplaintChannel1ID int32 `json:"complaint_channel1_id"`
ComplaintChannel1Name string `json:"complaint_channel1_name"`
ComplaintChannel2ID int32 `json:"complaint_channel2_id"`
ComplaintChannel2Name string `json:"complaint_channel2_name"`
ComplaintUsersID int32 `json:"complaint_users_id"`
Status int32 `json:"status"`
Nicelevel int32 `json:"nicelevel"`
ReviewedByID int32 `json:"reviewed_by_id"`
ReviewedTs int32 `json:"reviewed_ts"`
CreatedTs int32 `json:"created_ts"`
CreatedIp string `json:"created_ip"`
CreatedCrc string `json:"created_crc"`
CrcExpiration int32 `json:"crc_expiration"`
TicketNumber string `json:"ticket_number"`
CurrentOwner int32 `json:"current_owner"`
}
type ComplaintType ¶
type ComplaintsReference ¶
type ComplaintsThread ¶
type CreatePendingUserParams ¶
type CreatePendingUserParams struct {
UserName pgtype.Text `json:"user_name"`
Password password.Password `json:"password"`
Cookie pgtype.Text `json:"cookie"`
Expire pgtype.Int4 `json:"expire"`
Email pgtype.Text `json:"email"`
Language int32 `json:"language"`
QuestionID pgtype.Int2 `json:"question_id"`
Verificationdata pgtype.Text `json:"verificationdata"`
PosterIp pgtype.Text `json:"poster_ip"`
}
type CreateUserParams ¶
type CreateUserParams struct {
UserName string `json:"user_name"`
Password password.Password `json:"password"`
Flags flags.User `json:"flags"`
Email pgtype.Text `json:"email"`
LastUpdated int32 `json:"last_updated"`
LastUpdatedBy pgtype.Text `json:"last_updated_by"`
LanguageID pgtype.Int4 `json:"language_id"`
QuestionID pgtype.Int2 `json:"question_id"`
Verificationdata pgtype.Text `json:"verificationdata"`
PostForms int32 `json:"post_forms"`
SignupTs pgtype.Int4 `json:"signup_ts"`
SignupIp pgtype.Text `json:"signup_ip"`
Maxlogins pgtype.Int4 `json:"maxlogins"`
}
type DefaultMsg ¶
type DeletionTransaction ¶
type FraudListDatum ¶
type GetUserByIDRow ¶
type GetUserByIDRow struct {
ID int32 `json:"id"`
UserName string `json:"user_name"`
Password password.Password `json:"password"`
Email pgtype.Text `json:"email"`
Url pgtype.Text `json:"url"`
QuestionID pgtype.Int2 `json:"question_id"`
Verificationdata pgtype.Text `json:"verificationdata"`
LanguageID pgtype.Int4 `json:"language_id"`
PublicKey pgtype.Text `json:"public_key"`
PostForms int32 `json:"post_forms"`
Flags flags.User `json:"flags"`
LastUpdatedBy pgtype.Text `json:"last_updated_by"`
LastUpdated int32 `json:"last_updated"`
Deleted pgtype.Int2 `json:"deleted"`
TzSetting pgtype.Text `json:"tz_setting"`
SignupCookie pgtype.Text `json:"signup_cookie"`
SignupTs pgtype.Int4 `json:"signup_ts"`
SignupIp pgtype.Text `json:"signup_ip"`
Maxlogins pgtype.Int4 `json:"maxlogins"`
TotpKey pgtype.Text `json:"totp_key"`
LastSeen pgtype.Int4 `json:"last_seen"`
LanguageCode pgtype.Text `json:"language_code"`
LanguageName pgtype.Text `json:"language_name"`
}
type GetUserChannelsRow ¶
type GetUserChannelsRow struct {
Name string `json:"name"`
ChannelID int32 `json:"channel_id"`
UserID int32 `json:"user_id"`
Access int32 `json:"access"`
Flags int16 `json:"flags"`
LastModif pgtype.Int4 `json:"last_modif"`
SuspendExpires pgtype.Int4 `json:"suspend_expires"`
SuspendBy pgtype.Text `json:"suspend_by"`
}
type IpRestrict ¶
type IpRestrict struct {
ID pgtype.Int4 `json:"id"`
UserID int32 `json:"user_id"`
Added int32 `json:"added"`
AddedBy int32 `json:"added_by"`
Type int32 `json:"type"`
Value netip.Addr `json:"value"`
LastUpdated int32 `json:"last_updated"`
LastUsed int32 `json:"last_used"`
Expiry int32 `json:"expiry"`
Description pgtype.Text `json:"description"`
}
type Lastrequest ¶
type Level ¶
type Level struct {
ChannelID int32 `json:"channel_id"`
UserID int32 `json:"user_id"`
Access int32 `json:"access"`
Flags int16 `json:"flags"`
SuspendExpires pgtype.Int4 `json:"suspend_expires"`
SuspendLevel pgtype.Int4 `json:"suspend_level"`
SuspendBy pgtype.Text `json:"suspend_by"`
SuspendReason pgtype.Text `json:"suspend_reason"`
Added pgtype.Int4 `json:"added"`
AddedBy pgtype.Text `json:"added_by"`
LastModif pgtype.Int4 `json:"last_modif"`
LastModifBy pgtype.Text `json:"last_modif_by"`
LastUpdated int32 `json:"last_updated"`
Deleted pgtype.Int2 `json:"deleted"`
}
type Noreg ¶
type Noreg struct {
ID pgtype.Int4 `json:"id"`
UserName pgtype.Text `json:"user_name"`
Email pgtype.Text `json:"email"`
ChannelName pgtype.Text `json:"channel_name"`
Type int32 `json:"type"`
NeverReg int32 `json:"never_reg"`
ForReview int32 `json:"for_review"`
ExpireTime pgtype.Int4 `json:"expire_time"`
CreatedTs pgtype.Int4 `json:"created_ts"`
SetBy pgtype.Text `json:"set_by"`
Reason pgtype.Text `json:"reason"`
}
type Pending ¶
type Pending struct {
ChannelID int32 `json:"channel_id"`
ManagerID pgtype.Int4 `json:"manager_id"`
CreatedTs int32 `json:"created_ts"`
CheckStartTs int32 `json:"check_start_ts"`
Status pgtype.Int4 `json:"status"`
JoinCount pgtype.Int4 `json:"join_count"`
UniqueJoinCount pgtype.Int4 `json:"unique_join_count"`
DecisionTs pgtype.Int4 `json:"decision_ts"`
Decision pgtype.Text `json:"decision"`
Managername pgtype.Text `json:"managername"`
RegAcknowledged pgtype.Text `json:"reg_acknowledged"`
Comments pgtype.Text `json:"comments"`
LastUpdated int32 `json:"last_updated"`
Description pgtype.Text `json:"description"`
Reviewed string `json:"reviewed"`
FirstInit string `json:"first_init"`
ReviewedByID pgtype.Int4 `json:"reviewed_by_id"`
}
type PendingChanfixScore ¶
type PendingChanfixScore struct {
ChannelID pgtype.Int4 `json:"channel_id"`
UserID string `json:"user_id"`
Rank int32 `json:"rank"`
Score int32 `json:"score"`
Account string `json:"account"`
FirstOpped pgtype.Text `json:"first_opped"`
LastOpped pgtype.Text `json:"last_opped"`
LastUpdated int32 `json:"last_updated"`
First string `json:"first"`
}
type PendingEmailchange ¶
type PendingMgrchange ¶
type PendingMgrchange struct {
ID pgtype.Int4 `json:"id"`
ChannelID int32 `json:"channel_id"`
ManagerID int32 `json:"manager_id"`
NewManagerID int32 `json:"new_manager_id"`
ChangeType pgtype.Int2 `json:"change_type"`
OptDuration pgtype.Int4 `json:"opt_duration"`
Reason pgtype.Text `json:"reason"`
Expiration pgtype.Int4 `json:"expiration"`
Crc pgtype.Text `json:"crc"`
Confirmed pgtype.Int2 `json:"confirmed"`
FromHost pgtype.Text `json:"from_host"`
}
type PendingPasswordchange ¶
type PendingPwreset ¶
type PendingTraffic ¶
type Pendinguser ¶
type Pendinguser struct {
UserName pgtype.Text `json:"user_name"`
Cookie pgtype.Text `json:"cookie"`
Email pgtype.Text `json:"email"`
Expire pgtype.Int4 `json:"expire"`
QuestionID pgtype.Int2 `json:"question_id"`
Verificationdata pgtype.Text `json:"verificationdata"`
PosterIp pgtype.Text `json:"poster_ip"`
Language int32 `json:"language"`
Password password.Password `json:"password"`
}
type Querier ¶
type Querier interface {
CheckEmailExists(ctx context.Context, email string) ([]pgtype.Text, error)
CheckUsernameExists(ctx context.Context, username string) ([]string, error)
CreatePendingUser(ctx context.Context, arg CreatePendingUserParams) (pgtype.Text, error)
CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
DeletePendingUserByCookie(ctx context.Context, cookie pgtype.Text) error
GetGlineByIP(ctx context.Context, host string) (Gline, error)
GetUserByEmail(ctx context.Context, email string) (User, error)
GetUserByID(ctx context.Context, id int32) (GetUserByIDRow, error)
GetUserByUsername(ctx context.Context, username string) (User, error)
GetUserChannels(ctx context.Context, userID int32) ([]GetUserChannelsRow, error)
GetWhiteListByIP(ctx context.Context, ip netip.Addr) (Whitelist, error)
ListPendingUsers(ctx context.Context) ([]Pendinguser, error)
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CheckEmailExists ¶ added in v0.0.4
func (*Queries) CheckUsernameExists ¶ added in v0.0.4
func (*Queries) CreatePendingUser ¶
func (*Queries) CreateUser ¶
func (*Queries) DeletePendingUserByCookie ¶
func (*Queries) GetGlineByIP ¶ added in v0.0.3
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserByID ¶
func (*Queries) GetUserByUsername ¶
func (*Queries) GetUserChannels ¶
func (*Queries) GetWhiteListByIP ¶ added in v0.0.3
func (*Queries) ListPendingUsers ¶
func (q *Queries) ListPendingUsers(ctx context.Context) ([]Pendinguser, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a wrapper around the database queries
func (*Service) CheckEmailExists ¶ added in v0.0.4
CheckEmailExists checks if an email exists
func (*Service) CheckUsernameExists ¶ added in v0.0.4
CheckUsernameExists checks if a username exists
func (*Service) CreatePendingUser ¶
func (s *Service) CreatePendingUser(ctx context.Context, arg CreatePendingUserParams) (pgtype.Text, error)
CreatePendingUser creates a new pending user
func (*Service) CreateUser ¶
CreateUser creates a new user
func (*Service) DeletePendingUserByCookie ¶
DeletePendingUserByCookie deletes a pending user by cookie
func (*Service) GetGlineByIP ¶ added in v0.0.3
GetGlineByIP returns a gline entry by IP if it exists
func (*Service) GetUserByEmail ¶
GetUserByEmail gets a user by email
func (*Service) GetUserByID ¶
GetUserByID gets a user by ID
func (*Service) GetUserByUsername ¶
GetUserByUsername gets a user by username
func (*Service) GetUserChannels ¶
GetUserChannels gets a user's channels
func (*Service) GetWhiteListByIP ¶ added in v0.0.3
GetWhiteListByIP returns a whitelist entry by IP if it exists
func (*Service) ListPendingUsers ¶
func (s *Service) ListPendingUsers(ctx context.Context) ([]Pendinguser, error)
ListPendingUsers lists all pending users
type Supporter ¶
type Supporter struct {
ChannelID int32 `json:"channel_id"`
UserID int32 `json:"user_id"`
Support pgtype.Text `json:"support"`
Noticed string `json:"noticed"`
Reason pgtype.Text `json:"reason"`
JoinCount pgtype.Int4 `json:"join_count"`
LastUpdated int32 `json:"last_updated"`
Deleted pgtype.Int2 `json:"deleted"`
}
type Translation ¶
type User ¶
type User struct {
ID int32 `json:"id"`
UserName string `json:"user_name"`
Password password.Password `json:"password"`
Email pgtype.Text `json:"email"`
Url pgtype.Text `json:"url"`
QuestionID pgtype.Int2 `json:"question_id"`
Verificationdata pgtype.Text `json:"verificationdata"`
LanguageID pgtype.Int4 `json:"language_id"`
PublicKey pgtype.Text `json:"public_key"`
PostForms int32 `json:"post_forms"`
Flags flags.User `json:"flags"`
LastUpdatedBy pgtype.Text `json:"last_updated_by"`
LastUpdated int32 `json:"last_updated"`
Deleted pgtype.Int2 `json:"deleted"`
TzSetting pgtype.Text `json:"tz_setting"`
SignupCookie pgtype.Text `json:"signup_cookie"`
SignupTs pgtype.Int4 `json:"signup_ts"`
SignupIp pgtype.Text `json:"signup_ip"`
Maxlogins pgtype.Int4 `json:"maxlogins"`
TotpKey pgtype.Text `json:"totp_key"`
}
type UserSecHistory ¶
type UsersLastseen ¶
Click to show internal directories.
Click to hide internal directories.