models

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0, MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	TapExecutable        = "tap-pagerduty"
	StreamPropertiesFile = "pagerduty.json"
	IncidentStream       = "incidents"
)

The consts that this plugin needs

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiUserResponse

type ApiUserResponse struct {
	Id   int
	Name string `json:"name"`
}

Using User because it requires authentication.

type Assignment

type Assignment struct {
	common.NoPKModel
	ConnectionId   uint64
	UserId         string `gorm:"primaryKey"`
	IncidentNumber int    `gorm:"primaryKey"`
	AssignedAt     time.Time
}

func (Assignment) TableName

func (Assignment) TableName() string

type Incident

type Incident struct {
	common.NoPKModel
	ConnectionId uint64 `gorm:"primaryKey"`
	Number       int    `gorm:"primaryKey"`
	Url          string
	ServiceId    string
	Summary      string
	Status       IncidentStatus  //acknowledged, triggered, resolved
	Urgency      IncidentUrgency //high or low
	CreatedDate  time.Time
	UpdatedDate  time.Time
}

func (Incident) TableName

func (Incident) TableName() string

type IncidentStatus

type IncidentStatus string
const (
	IncidentStatusAcknowledged IncidentStatus = "acknowledged"
	IncidentStatusTriggered    IncidentStatus = "triggered"
	IncidentStatusResolved     IncidentStatus = "resolved"
)

type IncidentUrgency

type IncidentUrgency string

type PagerDutyConfig

type PagerDutyConfig struct {
	Token     string    `json:"token"`
	Email     string    `json:"email"` // Seems to be an inconsequential field
	StartDate time.Time `json:"start_date"`
}

PagerDutyConfig model corresponds to docs here https://github.com/singer-io/tap-pagerduty

type PagerDutyConnection

type PagerDutyConnection struct {
	helper.BaseConnection `mapstructure:",squash"`
	helper.AccessToken    `mapstructure:",squash"`
}

TODO Please modify the following code to fit your needs This object conforms to what the frontend currently sends.

func (PagerDutyConnection) TableName

func (PagerDutyConnection) TableName() string

type PagerDutyParams

type PagerDutyParams struct {
	ConnectionId uint64
	Stream       string
}

type PagerDutyResponse

type PagerDutyResponse struct {
	Name string `json:"name"`
	ID   int    `json:"id"`
	PagerDutyConnection
}

This object conforms to what the frontend currently expects.

type Service

type Service struct {
	common.NoPKModel
	ConnectionId uint64 `gorm:"primaryKey"`
	Url          string
	Id           string `gorm:"primaryKey"`
	Name         string
}

func (Service) TableName

func (Service) TableName() string

type TestConnectionRequest

type TestConnectionRequest struct {
	Endpoint string `json:"endpoint" validate:"required,url"`
	Token    string `json:"token" validate:"required"`
	Proxy    string `json:"proxy"`
}

type User

type User struct {
	common.NoPKModel
	ConnectionId uint64 `gorm:"primaryKey"`
	Id           string `gorm:"primaryKey"`
	Url          string
	Name         string
}

func (User) TableName

func (User) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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