entities

package
v0.0.0-...-b340e51 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMIT_STATE_COMMITTED = "committed"
	COMMIT_STATE_SUBMITTED = "submitted"
	COMMIT_STATE_APPROVED  = "approved"
	COMMIT_STATE_DEPLOYED  = "deployed"
)
View Source
const (
	EVENT_COMMIT                 = "commit"  // created commit
	EVENT_SUBMIT                 = "submit"  // submit to code review
	EVENT_APPROVE                = "approve" // approve code review
	EVENT_DEPLOY                 = "deploy"
	EVENT_INCIDENT_STATUS_CHANGE = "incident_status_change"
)
View Source
const (
	INCIDENT_STATE_OPEN     = " open"
	INCIDENT_STATE_RESOLVED = "resolved"
)
View Source
const (
	STATUS_SUCCESS = "success"
	STATUS_FAILURE = "failure"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	Model
	State          string
	CommitTime     time.Time
	SubmitTime     time.Time
	ApprovalTime   time.Time
	ReviewLeadTime int64
	PipelineId     string // external unique id of the component/pipeline tracked
	CommitId       string // external unique id of the commit
	PullRequestId  int64
}

type Deployment

type Deployment struct {
	Model
	Status      string
	Timestamp   time.Time
	LeadTime    int64
	CommitId    string
	PipelineId  string
	Environment string
}

type Event

type Event struct {
	Model
	PipelineId    string
	CommitId      string
	PullRequestId int64
	IncidentId    string
	Type          string // Event type
	Status        string // success or failure
	Timestamp     time.Time
	Environment   string
}

type Incident

type Incident struct {
	Model
	OpeningTime    time.Time // time of event
	ResolutionTime time.Time
	PipelineId     string // key used to group events
	State          string // opened, resolved
	Environment    string // dev, qa, prod
	TimeToRestore  int64
	IncidentId     string
	SourceId       string // Grouping id for incidents from the same source
}

type Model

type Model struct {
	ID        string `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

type User

type User struct {
	Model
	Username  string `gorm:"type:varchar(100);unique_index"`
	FirstName string
	LastName  string
	Email     string `gorm:"type:varchar(100);unique_index"`
}

Jump to

Keyboard shortcuts

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