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: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

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 GitlabAccount added in v0.12.0

type GitlabAccount struct {
	ConnectionId    uint64 `gorm:"primaryKey"`
	GitlabId        int    `gorm:"primaryKey" json:"id"`
	Username        string `gorm:"type:varchar(255)"`
	Email           string `gorm:"type:varchar(255)"`
	Name            string `gorm:"type:varchar(255)"`
	State           string `gorm:"type:varchar(255)"`
	MembershipState string `json:"membership_state" gorm:"type:varchar(255)"`
	AvatarUrl       string `json:"avatar_url" gorm:"type:varchar(255)"`
	WebUrl          string `json:"web_url" gorm:"type:varchar(255)"`

	common.NoPKModel
}

func (GitlabAccount) TableName added in v0.12.0

func (GitlabAccount) TableName() string

type GitlabCommit

type GitlabCommit struct {
	Sha            string `gorm:"primaryKey;type:varchar(40)"`
	Title          string
	Message        string
	ShortId        string `gorm:"type:varchar(255)"`
	AuthorName     string `gorm:"type:varchar(255)"`
	AuthorEmail    string `gorm:"type:varchar(255)"`
	AuthoredDate   time.Time
	CommitterName  string `gorm:"type:varchar(255)"`
	CommitterEmail string `gorm:"type:varchar(255)"`
	CommittedDate  time.Time
	WebUrl         string `gorm:"type:varchar(255)"`
	Additions      int    `gorm:"comment:Added lines of code"`
	Deletions      int    `gorm:"comment:Deleted lines of code"`
	Total          int    `gorm:"comment:Sum of added/deleted lines of code"`
	common.NoPKModel
}

func (GitlabCommit) TableName

func (GitlabCommit) TableName() string

type GitlabConnection

type GitlabConnection struct {
	helper.RestConnection `mapstructure:",squash"`
	helper.AccessToken    `mapstructure:",squash"`
}

This object conforms to what the frontend currently sends.

func (GitlabConnection) TableName added in v0.12.0

func (GitlabConnection) TableName() string

type GitlabIssue

type GitlabIssue struct {
	ConnectionId    uint64 `gorm:"primaryKey"`
	GitlabId        int    `gorm:"primaryKey"`
	ProjectId       int    `gorm:"index"`
	Number          int    `gorm:"index;comment:Used in API requests ex. api/repo/1/issue/<THIS_NUMBER>"`
	State           string `gorm:"type:varchar(255)"`
	Title           string
	Body            string
	Priority        string `gorm:"type:varchar(255)"`
	Type            string `gorm:"type:varchar(100)"`
	StdType         string `gorm:"type:varchar(100)"`
	Status          string `gorm:"type:varchar(255)"`
	CreatorId       int
	CreatorName     string `gorm:"type:varchar(255)"`
	AssigneeId      int
	AssigneeName    string `gorm:"type:varchar(255)"`
	LeadTimeMinutes uint
	Url             string `gorm:"type:varchar(255)"`
	ClosedAt        *time.Time
	GitlabCreatedAt time.Time
	GitlabUpdatedAt time.Time `gorm:"index"`
	Severity        string    `gorm:"type:varchar(255)"`
	Component       string    `gorm:"type:varchar(255)"`
	TimeEstimate    int64
	TotalTimeSpent  int64
	common.NoPKModel
}

func (GitlabIssue) TableName

func (GitlabIssue) TableName() string

type GitlabIssueLabel

type GitlabIssueLabel struct {
	ConnectionId uint64 `gorm:"primaryKey"`
	IssueId      int    `gorm:"primaryKey;autoIncrement:false"`
	LabelName    string `gorm:"primaryKey;type:varchar(255)"`
	common.NoPKModel
}

func (GitlabIssueLabel) TableName

func (GitlabIssueLabel) TableName() string

type GitlabJob added in v0.13.0

type GitlabJob struct {
	ConnectionId uint64 `gorm:"primaryKey"`

	GitlabId     int     `gorm:"primaryKey"`
	ProjectId    int     `gorm:"index"`
	PipelineId   int     `gorm:"index"`
	Status       string  `gorm:"type:varchar(255)"`
	Stage        string  `gorm:"type:varchar(255)"`
	Name         string  `gorm:"type:varchar(255)"`
	Ref          string  `gorm:"type:varchar(255)"`
	Tag          bool    `gorm:"type:boolean"`
	AllowFailure bool    `json:"allow_failure"`
	Duration     float64 `gorm:"type:float8"`
	WebUrl       string  `gorm:"type:varchar(255)"`

	GitlabCreatedAt *time.Time
	StartedAt       *time.Time
	FinishedAt      *time.Time

	common.NoPKModel
}

func (GitlabJob) TableName added in v0.13.0

func (GitlabJob) TableName() string

type GitlabMergeRequest

type GitlabMergeRequest struct {
	ConnectionId     uint64 `gorm:"primaryKey"`
	GitlabId         int    `gorm:"primaryKey"`
	Iid              int    `gorm:"index"`
	ProjectId        int    `gorm:"index"`
	SourceProjectId  int
	TargetProjectId  int
	State            string `gorm:"type:varchar(255)"`
	Title            string
	WebUrl           string `gorm:"type:varchar(255)"`
	UserNotesCount   int
	WorkInProgress   bool
	SourceBranch     string `gorm:"type:varchar(255)"`
	TargetBranch     string `gorm:"type:varchar(255)"`
	MergeCommitSha   string `gorm:"type:varchar(255)"`
	MergedAt         *time.Time
	GitlabCreatedAt  time.Time
	ClosedAt         *time.Time
	Type             string `gorm:"type:varchar(255)"`
	MergedByUsername string `gorm:"type:varchar(255)"`
	Description      string
	AuthorUsername   string `gorm:"type:varchar(255)"`
	AuthorUserId     int
	Component        string     `gorm:"type:varchar(255)"`
	FirstCommentTime *time.Time `gorm:"comment:Time when the first comment occurred"`
	ReviewRounds     int        `gorm:"comment:How many rounds of review this MR went through"`
	common.NoPKModel
}

func (GitlabMergeRequest) TableName

func (GitlabMergeRequest) TableName() string

type GitlabMrComment added in v0.12.0

type GitlabMrComment struct {
	ConnectionId uint64 `gorm:"primaryKey"`

	GitlabId        int `gorm:"primaryKey"`
	MergeRequestId  int `gorm:"index"`
	MergeRequestIid int `gorm:"comment:Used in API requests ex. /api/merge_requests/<THIS_IID>"`
	Body            string
	AuthorUsername  string `gorm:"type:varchar(255)"`
	AuthorUserId    int
	GitlabCreatedAt time.Time
	Resolvable      bool   `gorm:"comment:Is or is not review comment"`
	Type            string `gorm:"comment:if type=null, it is normal comment,if type=diffNote,it is diff comment"`
	common.NoPKModel
}

func (GitlabMrComment) TableName added in v0.12.0

func (GitlabMrComment) TableName() string

type GitlabMrCommit added in v0.12.0

type GitlabMrCommit struct {
	ConnectionId   uint64 `gorm:"primaryKey"`
	CommitSha      string `gorm:"primaryKey;type:varchar(40)"`
	MergeRequestId int    `gorm:"primaryKey;autoIncrement:false"`
	common.NoPKModel
}

func (GitlabMrCommit) TableName added in v0.12.0

func (GitlabMrCommit) TableName() string

type GitlabMrLabel added in v0.12.0

type GitlabMrLabel struct {
	ConnectionId uint64 `gorm:"primaryKey"`
	MrId         int    `gorm:"primaryKey;autoIncrement:false"`
	LabelName    string `gorm:"primaryKey;type:varchar(255)"`
	common.NoPKModel
}

func (GitlabMrLabel) TableName added in v0.12.0

func (GitlabMrLabel) TableName() string

type GitlabMrNote added in v0.12.0

type GitlabMrNote struct {
	ConnectionId uint64 `gorm:"primaryKey"`

	GitlabId        int    `gorm:"primaryKey"`
	MergeRequestId  int    `gorm:"index"`
	MergeRequestIid int    `gorm:"comment:Used in API requests ex. /api/merge_requests/<THIS_IID>"`
	NoteableType    string `gorm:"type:varchar(100)"`
	AuthorUserId    int
	AuthorUsername  string `gorm:"type:varchar(255)"`
	Body            string
	GitlabCreatedAt time.Time
	Confidential    bool
	Resolvable      bool   `gorm:"comment:Is or is not review comment"`
	IsSystem        bool   `gorm:"comment:Is or is not auto-generated vs. human generated"`
	Type            string `gorm:"comment:if type=null, it is normal comment,if type=diffNote,it is diff comment"`
	common.NoPKModel
}

func (GitlabMrNote) TableName added in v0.12.0

func (GitlabMrNote) TableName() string

type GitlabPipeline

type GitlabPipeline struct {
	ConnectionId uint64 `gorm:"primaryKey"`

	GitlabId  int    `gorm:"primaryKey"`
	ProjectId int    `gorm:"index"`
	Status    string `gorm:"type:varchar(100)"`
	Ref       string `gorm:"type:varchar(255)"`
	Sha       string `gorm:"type:varchar(255)"`
	WebUrl    string `gorm:"type:varchar(255)"`
	Duration  int

	GitlabCreatedAt *time.Time
	GitlabUpdatedAt *time.Time
	StartedAt       *time.Time
	FinishedAt      *time.Time
	Coverage        string

	common.NoPKModel
}

func (GitlabPipeline) TableName

func (GitlabPipeline) TableName() string

type GitlabPipelineProject added in v0.14.0

type GitlabPipelineProject struct {
	ConnectionId uint64 `gorm:"primaryKey"`
	PipelineId   int    `gorm:"primaryKey"`
	ProjectId    int    `gorm:"primaryKey"`
	Ref          string `gorm:"type:varchar(255)"`
	Sha          string `gorm:"type:varchar(255)"`
	common.NoPKModel
}

func (GitlabPipelineProject) TableName added in v0.14.0

func (GitlabPipelineProject) TableName() string

type GitlabProject

type GitlabProject struct {
	ConnectionId            uint64 `json:"connectionId" mapstructure:"connectionId" gorm:"primaryKey"`
	TransformationRuleId    uint64 `json:"transformationRuleId,omitempty" mapstructure:"transformationRuleId"`
	GitlabId                int    `json:"gitlabId" mapstructure:"gitlabId" gorm:"primaryKey"`
	Name                    string `json:"name" mapstructure:"name" gorm:"type:varchar(255)"`
	Description             string `json:"description" mapstructure:"description"`
	DefaultBranch           string `json:"defaultBranch" mapstructure:"defaultBranch" gorm:"type:varchar(255)"`
	PathWithNamespace       string `json:"pathWithNamespace" mapstructure:"pathWithNamespace" gorm:"type:varchar(255)"`
	WebUrl                  string `json:"webUrl" mapstructure:"webUrl" gorm:"type:varchar(255)"`
	CreatorId               int    `json:"creatorId" mapstructure:"creatorId"`
	Visibility              string `json:"visibility" mapstructure:"visibility" gorm:"type:varchar(255)"`
	OpenIssuesCount         int    `json:"openIssuesCount" mapstructure:"openIssuesCount"`
	StarCount               int    `json:"starCount" mapstructure:"StarCount"`
	ForkedFromProjectId     int    `json:"forkedFromProjectId" mapstructure:"forkedFromProjectId"`
	ForkedFromProjectWebUrl string `json:"forkedFromProjectWebUrl" mapstructure:"forkedFromProjectWebUrl" gorm:"type:varchar(255)"`
	HttpUrlToRepo           string `json:"httpUrlToRepo" gorm:"varchar(255)"`

	CreatedDate      time.Time  `json:"createdDate" mapstructure:"-"`
	UpdatedDate      *time.Time `json:"updatedDate" mapstructure:"-"`
	common.NoPKModel `json:"-" mapstructure:"-"`
}

func (GitlabProject) TableName

func (GitlabProject) TableName() string

type GitlabProjectCommit

type GitlabProjectCommit struct {
	ConnectionId uint64 `gorm:"primaryKey"`

	GitlabProjectId int    `gorm:"primaryKey"`
	CommitSha       string `gorm:"primaryKey;type:varchar(40)"`
	common.NoPKModel
}

func (GitlabProjectCommit) TableName

func (GitlabProjectCommit) TableName() string

type GitlabResponse

type GitlabResponse struct {
	Name string `json:"name"`
	ID   int    `json:"id"`
	GitlabConnection
}

This object conforms to what the frontend currently expects.

type GitlabReviewer

type GitlabReviewer struct {
	ConnectionId uint64 `gorm:"primaryKey"`

	GitlabId       int    `gorm:"primaryKey"`
	MergeRequestId int    `gorm:"index"`
	ProjectId      int    `gorm:"index"`
	Name           string `gorm:"type:varchar(255)"`
	Username       string `gorm:"type:varchar(255)"`
	State          string `gorm:"type:varchar(255)"`
	AvatarUrl      string `gorm:"type:varchar(255)"`
	WebUrl         string `gorm:"type:varchar(255)"`
	common.NoPKModel
}

func (GitlabReviewer) TableName

func (GitlabReviewer) TableName() string

type GitlabTag

type GitlabTag struct {
	ConnectionId       uint64 `gorm:"primaryKey"`
	Name               string `gorm:"primaryKey;type:varchar(60)"`
	Message            string
	Target             string `gorm:"type:varchar(255)"`
	Protected          bool
	ReleaseDescription string
	common.NoPKModel
}

func (GitlabTag) TableName

func (GitlabTag) TableName() string

type GitlabTransformationRule added in v0.15.0

type GitlabTransformationRule struct {
	common.Model
	Name                 string            `gorm:"type:varchar(255);index:idx_name_gitlab,unique" validate:"required" mapstructure:"name" json:"name"`
	PrType               string            `mapstructure:"prType" json:"prType"`
	PrComponent          string            `mapstructure:"prComponent" json:"prComponent"`
	PrBodyClosePattern   string            `mapstructure:"prBodyClosePattern" json:"prBodyClosePattern"`
	IssueSeverity        string            `mapstructure:"issueSeverity" json:"issueSeverity"`
	IssuePriority        string            `mapstructure:"issuePriority" json:"issuePriority"`
	IssueComponent       string            `mapstructure:"issueComponent" json:"issueComponent"`
	IssueTypeBug         string            `mapstructure:"issueTypeBug" json:"issueTypeBug"`
	IssueTypeIncident    string            `mapstructure:"issueTypeIncident" json:"issueTypeIncident"`
	IssueTypeRequirement string            `mapstructure:"issueTypeRequirement" json:"issueTypeRequirement"`
	DeploymentPattern    string            `mapstructure:"deploymentPattern" json:"deploymentPattern"`
	ProductionPattern    string            `mapstructure:"productionPattern,omitempty" json:"productionPattern" gorm:"type:varchar(255)"`
	Refdiff              datatypes.JSONMap `mapstructure:"refdiff,omitempty" json:"refdiff" swaggertype:"object" format:"json"`
}

func (GitlabTransformationRule) TableName added in v0.15.0

func (t GitlabTransformationRule) TableName() string

type TestConnectionRequest

type TestConnectionRequest struct {
	Endpoint           string `json:"endpoint"`
	Proxy              string `json:"proxy"`
	helper.AccessToken `mapstructure:",squash"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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