Documentation ¶
Index ¶
- func CountWebhook() int64
- func DeleteApplicationByID(id int64) error
- func DeleteCollectorByID(id int64) error
- func IsRecordNotFound(err error) bool
- func NewWebhook(webhook *Webhook) error
- func RegenerateApplicationToken(id int64) error
- func RegenerateCollectorSecret(id int64) error
- func UpdateApplication(app *Application) error
- func UpdateCollector(collector *Collector) error
- type Application
- type CollectType
- type Collector
- type Engine
- type QueryWebhookOptions
- type Webhook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountWebhook ¶
func CountWebhook() int64
func DeleteApplicationByID ¶
func IsRecordNotFound ¶
func NewWebhook ¶
func UpdateApplication ¶
func UpdateApplication(app *Application) error
func UpdateCollector ¶
Types ¶
type Application ¶
type Application struct { ID int64 Name string `sql:"unique"` Token string `sql:"unique"` Created int64 }
Application represents a consumer application that calls APIs.
func GetApplicationByID ¶
func GetApplicationByID(id int64) (*Application, error)
func GetApplicationByToken ¶
func GetApplicationByToken(token string) (*Application, error)
func ListApplications ¶
func ListApplications() ([]*Application, error)
func NewApplication ¶
func NewApplication(name string) (*Application, error)
func (*Application) CreatedTime ¶
func (app *Application) CreatedTime() time.Time
type CollectType ¶
type CollectType int
const (
COLLECT_TYPE_GITHUB CollectType = iota + 1
)
func (CollectType) String ¶
func (t CollectType) String() string
type Collector ¶
type Collector struct { ID int64 Name string `sql:"unique"` Type CollectType Secret string `sql:"unique"` Created int64 }
Collector represents a type of webhook collection to be stored.
func GetCollectorByID ¶
func GetCollectorBySecret ¶
func ListCollectors ¶
func NewCollector ¶
func NewCollector(name string, tp CollectType) (*Collector, error)
func (*Collector) CreatedTime ¶
type QueryWebhookOptions ¶
type Webhook ¶
type Webhook struct { ID int64 CollectorID int64 `sql:"index"` Owner string RepoName string EventType string Sender string Payload string `sql:"type:text"` Created int64 }
Webhook represents a history record of webhook.
func GetWebhookByID ¶
func QueryWebhooks ¶
func QueryWebhooks(opts QueryWebhookOptions) ([]*Webhook, error)
func (*Webhook) CreatedTime ¶
Click to show internal directories.
Click to hide internal directories.