model

package
v0.0.0-...-49d4ca0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migration

func Migration()

Types

type Base

type Base struct {
	ID          uint            `gorm:"primary_key" json:"id"`
	CreatedAt   time.Time       `json:"created_at"`
	UpdatedAt   time.Time       `json:"updated_at"`
	DeletedAt   *gorm.DeletedAt `sql:"index" json:"deleted_at" swaggertype:"primitive,string"`
	CreatedByID uint            `gorm:"column:created_by_id" json:"created_by_id"`
	UpdatedByID uint            `gorm:"column:updated_by_id" json:"updated_by_id"`
}

Base base model class

type ContextKey

type ContextKey string

ContextKey keys for contexts

type Event

type Event struct {
	Base
	Name     string         `gorm:"column:name" json:"name"`
	Event    string         `gorm:"column:event" json:"event"`
	Webhooks []Webhook      `gorm:"many2many:webhook_events" json:"events,omitempty"`
	Tags     postgres.Jsonb `gorm:"column:tags" json:"tags" swaggertype:"primitive,string"`
}

Event model

func (*Event) BeforeCreate

func (event *Event) BeforeCreate(tx *gorm.DB) error

BeforeCreate hook

type Webhook

type Webhook struct {
	Base
	Name    string         `gorm:"column:name" json:"name"`
	URL     string         `gorm:"column:url" json:"url"`
	Enabled bool           `gorm:"column:enabled" json:"enabled"`
	Events  []Event        `gorm:"many2many:webhook_events;" json:"events"`
	Tags    postgres.Jsonb `gorm:"column:tags" json:"tags" swaggertype:"primitive,string"`
	SpaceID uint           `gorm:"column:space_id" json:"space_id"`
}

Webhook model

func (*Webhook) BeforeCreate

func (wh *Webhook) BeforeCreate(tx *gorm.DB) error

BeforeCreate hook

type WebhookData

type WebhookData struct {
	Event     string      `json:"event,omitempty"`
	Contains  []string    `json:"contains,omitempty"`
	CreatedAt time.Time   `json:"created_at,omitempty"`
	Payload   interface{} `json:"payload,omitempty"`
}

WebhookData general struct to fire webhook

type WebhookLog

type WebhookLog struct {
	ID                 uint           `gorm:"primary_key" json:"id"`
	CreatedAt          time.Time      `json:"created_at"`
	CreatedByID        uint           `gorm:"column:created_by_id" json:"created_by_id"`
	Event              string         `gorm:"column:event" json:"event"`
	URL                string         `gorm:"column:url" json:"url"`
	ResponseStatusCode int            `gorm:"column:response_status_code" json:"response_status_code"`
	Data               postgres.Jsonb `gorm:"column:data" json:"data" swaggertype:"primitive,string"`
	ResponseBody       postgres.Jsonb `gorm:"column:response_body" json:"response_body" swaggertype:"primitive,string"`
	Tags               postgres.Jsonb `gorm:"column:tags" json:"tags" swaggertype:"primitive,string"`
}

WebhookLog model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL