Documentation
¶
Index ¶
- type AppLog
- type Group
- func (m *Group) Count(userID int) int
- func (m *Group) Create(exec any) error
- func (m *Group) Delete(id, userID int) error
- func (m *Group) Get(userID, id, uid int) ([]*Group, error)
- func (m *Group) IDExists(id, userID int) (bool, error)
- func (m *Group) NameExists() (bool, error)
- func (m *Group) Paginate(userID, offset, limit int, search string) []*Group
- func (m *Group) Update(query string, params []any) error
- type GroupUpdate
- type Login
- type Notification
- func (m *Notification) Count(userId int) int
- func (m *Notification) Create(exec any) error
- func (m *Notification) Delete(id, userID int) error
- func (m *Notification) Get(userID, id int, title string) ([]*Notification, error)
- func (m *Notification) IDExists(id, userID int) (bool, error)
- func (m *Notification) Paginate(userID, offset, limit int, search string) []*Notification
- func (m *Notification) TitleExists() (bool, error)
- func (m *Notification) Update(query string, params []any) error
- type NotificationBulk
- type NotificationUpdate
- type NotifyEmail
- func (m *NotifyEmail) Count(userId int) int
- func (m *NotifyEmail) Create(exec any) error
- func (m *NotifyEmail) Delete(id, userID int) error
- func (m *NotifyEmail) EmailExists(exec any, userID int) (bool, error)
- func (m *NotifyEmail) Get(userID, id int, email string) ([]*NotifyEmail, error)
- func (m *NotifyEmail) IDExists(id, userID int) (bool, error)
- func (m *NotifyEmail) Paginate(userID, offset, limit int, search string) []*NotifyEmail
- func (m *NotifyEmail) Update(query string, params []any) error
- type NotifyEmailBulk
- type NotifyEmailUpdate
- type NotifyMessage
- func (m *NotifyMessage) Count(userId int) int
- func (m *NotifyMessage) Create(exec any) error
- func (m *NotifyMessage) Delete(id, userID int) error
- func (m *NotifyMessage) Get(userID, id int, phone string) ([]*NotifyMessage, error)
- func (m *NotifyMessage) IDExists(id, userID int) (bool, error)
- func (m *NotifyMessage) Paginate(userID, offset, limit int, search string) []*NotifyMessage
- func (m *NotifyMessage) PhoneExists(exec any, userID int) (bool, error)
- func (m *NotifyMessage) Update(query string, params []any) error
- type NotifyMessageBulk
- type NotifyMessageUpdate
- type PasswordUpdate
- type ProfileUpdate
- type Register
- type Request
- func (m *Request) Count(userID int) int
- func (m *Request) Create(exec any) error
- func (m *Request) Delete(id, userID int) error
- func (m *Request) Get(userID, id int, url string) ([]*Request, error)
- func (m *Request) IDExists(id, userID int) (bool, error)
- func (m *Request) Paginate(userID, offset, limit int, search string) []*Request
- func (m *Request) Update(query string, params []any) error
- func (m *Request) UrlExists() (bool, error)
- type RequestBulk
- type RequestHeader
- func (m *RequestHeader) Count(userID int) int
- func (m *RequestHeader) Create(exec any) error
- func (m *RequestHeader) Delete(id, userID int) error
- func (m *RequestHeader) Get(userID, id, requestID int, key string) ([]*RequestHeader, error)
- func (m *RequestHeader) HeaderExists(exec any, userID int) (bool, error)
- func (m *RequestHeader) IDExists(id, userID int) (bool, error)
- func (m *RequestHeader) Paginate(userID, offset, limit int, search string) []*RequestHeader
- func (m *RequestHeader) Update(query string, params []any) error
- type RequestHeaderBulk
- type RequestHeaderUpdate
- type RequestUpdate
- type Schedule
- func (m *Schedule) Count(userID int) int
- func (m *Schedule) Create(exec any) error
- func (m *Schedule) Delete(id, userID int) error
- func (m *Schedule) Get(id, userID, groupID, requestID, NotificationID int, timing string) ([]*Schedule, error)
- func (m *Schedule) IDExists(id, userID int) (bool, error)
- func (m *Schedule) Paginate(userID, offset, limit int, search string) []*Schedule
- func (m *Schedule) TimingExists(userID int) (bool, error)
- func (m *Schedule) Update(query string, params []any) error
- func (m *Schedule) WithQuery(userID, offset, limit int, search string) []*Schedule
- func (m *Schedule) WithQueryAll() []*Schedule
- type ScheduleBulk
- type ScheduleLog
- type ScheduleUpdate
- type Triggered
- type User
- func (m *User) Count() int
- func (m *User) Create(register *Register) error
- func (m *User) Delete(userID int) error
- func (m *User) Exists(email string) (bool, error)
- func (m *User) Get(offset, limit int, search string) []*User
- func (m *User) GetWithId(id int) error
- func (m *User) GetWithMail(email string) error
- func (m *User) IDExists(id int) (bool, error)
- func (m *User) LastLoginUpdate() error
- func (m *User) PasswordUpdate(password string) error
- func (m *User) ProfileUpdate(query string, params []any) error
- type Webhook
- func (m *Webhook) Count(userID int) int
- func (m *Webhook) Create() error
- func (m *Webhook) Delete(id, userID int) error
- func (m *Webhook) Get(id, schedule_id, request_id, user_id int) ([]*Webhook, error)
- func (m *Webhook) IDExists(id, userID int) (bool, error)
- func (m *Webhook) Paginate(userID, offset, limit int, search string) []*Webhook
- func (m *Webhook) UniqExists(scheduleID, requestID, userID int) (bool, error)
- func (m *Webhook) Update(query string, params []any) error
- type WebhookUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppLog ¶
type Group ¶
type Group struct { ID int `json:"id"` UID int `json:"uid" validate:"number"` UserID int `json:"user_id" validate:"number"` Name string `json:"name" validate:"required"` Active bool `json:"active" validate:"boolean"` Parent *Group `json:"parent,omitempty"` User *User `json:"user,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
func (*Group) NameExists ¶
type GroupUpdate ¶
type Notification ¶
type Notification struct { ID int `json:"id"` UserID int `json:"user_id" validate:"number"` Title string `json:"title" validate:"required"` Content string `json:"content" validate:"required"` IsMail bool `json:"is_mail" validate:"boolean"` IsMessage bool `json:"is_message" validate:"boolean"` Active bool `json:"active" validate:"boolean"` User *User `json:"user,omitempty"` NotifyEmails []*NotifyEmail `json:"emails,omitempty"` NotifyMessages []*NotifyMessage `json:"messages,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
func (*Notification) Count ¶
func (m *Notification) Count(userId int) int
func (*Notification) Create ¶
func (m *Notification) Create(exec any) error
func (*Notification) Delete ¶
func (m *Notification) Delete(id, userID int) error
func (*Notification) Get ¶
func (m *Notification) Get(userID, id int, title string) ([]*Notification, error)
func (*Notification) Paginate ¶
func (m *Notification) Paginate(userID, offset, limit int, search string) []*Notification
func (*Notification) TitleExists ¶
func (m *Notification) TitleExists() (bool, error)
type NotificationBulk ¶
type NotificationBulk struct { UserID int `json:"user_id" validate:"number"` Title string `json:"title" validate:"required"` Content string `json:"content" validate:"required"` IsMail bool `json:"is_mail" validate:"boolean"` IsMessage bool `json:"is_message" validate:"boolean"` Active bool `json:"active" validate:"boolean"` NotifyEmails []*NotifyEmailBulk `json:"notify_emails" validate:"required_without=NotifyMessages,dive"` NotifyMessages []*NotifyMessageBulk `json:"notify_messages" validate:"required_without=NotifyEmails,dive"` }
type NotificationUpdate ¶
type NotificationUpdate struct { UserID int `json:"user_id" validate:"omitempty,number"` Title string `json:"title" validate:"omitempty"` Content string `json:"content" validate:"omitempty"` IsMessage *bool `json:"is_message" validate:"omitnil,boolean"` IsMail *bool `json:"is_mail" validate:"omitnil,boolean"` Active *bool `json:"active" validate:"omitnil,boolean"` }
type NotifyEmail ¶
type NotifyEmail struct { ID int `json:"id"` NotificationID int `json:"notification_id" validate:"required,number"` Email string `json:"email" validate:"required,email"` Active bool `json:"active" validate:"boolean"` Notification *Notification `json:"notification,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
func (*NotifyEmail) Count ¶
func (m *NotifyEmail) Count(userId int) int
func (*NotifyEmail) Create ¶
func (m *NotifyEmail) Create(exec any) error
func (*NotifyEmail) Delete ¶
func (m *NotifyEmail) Delete(id, userID int) error
func (*NotifyEmail) EmailExists ¶
func (m *NotifyEmail) EmailExists(exec any, userID int) (bool, error)
func (*NotifyEmail) Get ¶
func (m *NotifyEmail) Get(userID, id int, email string) ([]*NotifyEmail, error)
func (*NotifyEmail) Paginate ¶
func (m *NotifyEmail) Paginate(userID, offset, limit int, search string) []*NotifyEmail
type NotifyEmailBulk ¶
type NotifyEmailUpdate ¶
type NotifyMessage ¶
type NotifyMessage struct { ID int `json:"id"` NotificationID int `json:"notification_id" validate:"required,number"` Phone string `json:"phone" validate:"required,e164"` Active bool `json:"active" validate:"boolean"` Notification *Notification `json:"notification,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
func (*NotifyMessage) Count ¶
func (m *NotifyMessage) Count(userId int) int
func (*NotifyMessage) Create ¶
func (m *NotifyMessage) Create(exec any) error
func (*NotifyMessage) Delete ¶
func (m *NotifyMessage) Delete(id, userID int) error
func (*NotifyMessage) Get ¶
func (m *NotifyMessage) Get(userID, id int, phone string) ([]*NotifyMessage, error)
func (*NotifyMessage) Paginate ¶
func (m *NotifyMessage) Paginate(userID, offset, limit int, search string) []*NotifyMessage
func (*NotifyMessage) PhoneExists ¶
func (m *NotifyMessage) PhoneExists(exec any, userID int) (bool, error)
type NotifyMessageBulk ¶
type NotifyMessageUpdate ¶
type PasswordUpdate ¶
type ProfileUpdate ¶
type ProfileUpdate struct { ID int `json:"id" validate:"omitempty"` // This field is required if the administrator wants to update a user. Fullname string `json:"fullname" validate:"omitempty"` Email string `json:"email" validate:"omitempty,email"` Phone string `json:"phone" validate:"omitempty,e164"` }
type Request ¶
type Request struct { ID int `json:"id"` UserID int `json:"user_id" validate:"number"` Url string `json:"url" validate:"required,url"` Method string `json:"method" validate:"required,oneof=GET POST PUT PATCH"` Content json.RawMessage `json:"content" validate:"omitempty,json"` Active bool `json:"active" validate:"boolean"` User *User `json:"user,omitempty"` RequestHeaders []*RequestHeader `json:"request_headers,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
type RequestBulk ¶
type RequestBulk struct { UserID int `json:"user_id" validate:"number"` Url string `json:"url" validate:"required,url"` Method string `json:"method" validate:"required,oneof=GET POST PUT PATCH"` Content string `json:"content" validate:"omitempty,json"` Active bool `json:"active" validate:"boolean"` RequestHeaders []*RequestHeaderBulk `json:"request_headers" validate:"required,nonempty,dive"` }
type RequestHeader ¶
type RequestHeader struct { ID int `json:"id"` RequestID int `json:"request_id" validate:"required,number"` Key string `json:"key" validate:"required"` Value string `json:"value" validate:"required"` Active bool `json:"active" validate:"boolean"` Request *Request `json:"request,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
func (*RequestHeader) Count ¶
func (m *RequestHeader) Count(userID int) int
func (*RequestHeader) Create ¶
func (m *RequestHeader) Create(exec any) error
func (*RequestHeader) Delete ¶
func (m *RequestHeader) Delete(id, userID int) error
func (*RequestHeader) Get ¶
func (m *RequestHeader) Get(userID, id, requestID int, key string) ([]*RequestHeader, error)
func (*RequestHeader) HeaderExists ¶
func (m *RequestHeader) HeaderExists(exec any, userID int) (bool, error)
func (*RequestHeader) Paginate ¶
func (m *RequestHeader) Paginate(userID, offset, limit int, search string) []*RequestHeader
type RequestHeaderBulk ¶
type RequestHeaderUpdate ¶
type RequestUpdate ¶
type RequestUpdate struct { UserID int `json:"user_id" validate:"omitempty,number"` Url string `json:"url" validate:"omitempty,url"` Method string `json:"method" validate:"omitempty,oneof=GET POST PUT PATCH"` Content string `json:"content" validate:"omitempty,json"` Active *bool `json:"active" validate:"omitnil,boolean"` }
type Schedule ¶
type Schedule struct { ID int `json:"id"` UserID int `json:"user_id" validate:"number"` GroupID int `json:"group_id" validate:"required,number"` RequestID int `json:"request_id" validate:"required,number"` NotificationID int `json:"notification_id" validate:"required,number"` Timing string `json:"timing" validate:"required,cron"` // https://crontab.guru/ Timeout int `json:"timeout" validate:"number"` Retries int `json:"retries" validate:"number"` Running bool `json:"running" validate:"boolean"` Active bool `json:"active" validate:"boolean"` User *User `json:"user,omitempty"` Group *Group `json:"group,omitempty"` Request *Request `json:"request,omitempty"` Notification *Notification `json:"notification,omitempty"` Webhooks []*Webhook `json:"webhooks,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
func (*Schedule) WithQueryAll ¶
type ScheduleBulk ¶
type ScheduleBulk struct { UserID int `json:"user_id" validate:"number"` GroupID int `json:"group_id" validate:"number"` RequestID int `json:"request_id" validate:"number"` NotificationID int `json:"notification_id" validate:"number"` Timing string `json:"timing" validate:"required,cron"` Timeout int `json:"timeout" validate:"number"` Retries int `json:"retries" validate:"number"` Running bool `json:"running" validate:"boolean"` Active bool `json:"active" validate:"boolean"` Group *Group `json:"group" validate:"omitempty"` Request *RequestBulk `json:"request" validate:"omitempty"` Notification *NotificationBulk `json:"notification" validate:"omitempty"` }
type ScheduleLog ¶
type ScheduleLog struct { ID int `json:"id"` ScheduleID int `json:"schedule_id" validate:"required"` Took float32 `json:"took" validate:"required"` Result any `json:"result" validate:"required"` Schedule *Schedule `json:"schedule,omitempty"` StartedAt *time.Time `json:"started_at,omitempty"` FinishedAt *time.Time `json:"finished_at,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` }
func (*ScheduleLog) Count ¶
func (m *ScheduleLog) Count(userID int) int
func (*ScheduleLog) Create ¶
func (m *ScheduleLog) Create(scheduleId int) error
func (*ScheduleLog) Get ¶
func (m *ScheduleLog) Get(id, schedule_id, user_id int) ([]*ScheduleLog, error)
func (*ScheduleLog) Paginate ¶
func (m *ScheduleLog) Paginate(userID, offset, limit int, search string) []*ScheduleLog
type ScheduleUpdate ¶
type ScheduleUpdate struct { GroupID int `json:"group_id" validate:"omitempty,number"` RequestID int `json:"request_id" validate:"omitempty,number"` NotificationID int `json:"notification_id" validate:"omitempty,number"` Timing string `json:"timing" validate:"omitempty,cron"` Timeout *int `json:"timeout" validate:"omitnil,number"` Retries *int `json:"retries" validate:"omitnil,number"` Active *bool `json:"active" validate:"omitnil,boolean"` }
type User ¶
type User struct { ID int `json:"id"` Fullname string `json:"fullname" validate:"required"` Email string `json:"email" validate:"required,email"` Password string `json:"-" validate:"required"` Phone string `json:"phone" validate:"required,e164"` Active bool `json:"active"` IsAdmin bool `json:"is_admin"` LastLogin *time.Time `json:"last_login,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
func (*User) GetWithMail ¶
func (*User) LastLoginUpdate ¶
func (*User) PasswordUpdate ¶
type Webhook ¶
type Webhook struct { ID int `json:"id"` ScheduleID int `json:"schedule_id" validate:"required,number"` RequestID int `json:"request_id" validate:"required,number"` Active bool `json:"active" validate:"boolean"` Schedule *Schedule `json:"schedule,omitempty"` Request *Request `json:"request,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
func (*Webhook) UniqExists ¶
type WebhookUpdate ¶
Click to show internal directories.
Click to hide internal directories.