models

package
v0.0.0-...-1fa52ee Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0, BSD-2-Clause, ISC, + 1 more Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureDevOpsPK

type AzureDevOpsPK struct {
	OrganizationId string
	ProjectId      string
}

type AzuredevopsAccessToken

type AzuredevopsAccessToken struct {
	Token string `mapstructure:"token" validate:"required" json:"token" gorm:"serializer:encdec"`
}

AzuredevopsAccessToken implements HTTP Bearer Authentication with Access Token

func (*AzuredevopsAccessToken) GetAccessTokenAuthenticator

func (at *AzuredevopsAccessToken) GetAccessTokenAuthenticator() plugin.ApiAuthenticator

GetAccessTokenAuthenticator returns SetupAuthentication

func (*AzuredevopsAccessToken) SetupAuthentication

func (at *AzuredevopsAccessToken) SetupAuthentication(req *http.Request) errors.Error

SetupAuthentication sets up the HTTP Request Authentication

type AzuredevopsApiBuild

type AzuredevopsApiBuild struct {
	Id          int       `json:"id"`
	BuildNumber string    `json:"buildNumber"`
	Status      string    `json:"status"`
	Result      string    `json:"result"`
	QueueTime   time.Time `json:"queueTime"`
	StartTime   time.Time `json:"startTime"`
	FinishTime  time.Time `json:"finishTime"`
	Url         string    `json:"url"`
	Definition  struct {
		Drafts      []interface{} `json:"drafts"`
		Id          int           `json:"id"`
		Name        string        `json:"name"`
		Url         string        `json:"url"`
		Uri         string        `json:"uri"`
		Path        string        `json:"path"`
		Type        string        `json:"type"`
		QueueStatus string        `json:"queueStatus"`
		Revision    int           `json:"revision"`
	} `json:"definition"`
	BuildNumberRevision int      `json:"buildNumberRevision"`
	Uri                 string   `json:"uri"`
	SourceBranch        string   `json:"sourceBranch"`
	SourceVersion       string   `json:"sourceVersion"`
	Priority            string   `json:"priority"`
	Reason              string   `json:"reason"`
	Tags                []string `json:"tags"`
}

type AzuredevopsApiParams

type AzuredevopsApiParams struct {
	ConnectionId uint64
	Name         string
}

type AzuredevopsApiPrCommit

type AzuredevopsApiPrCommit struct {
	CommitId string `json:"commitId"`
	Author   struct {
		Name  string    `json:"name"`
		Email string    `json:"email"`
		Date  time.Time `json:"date"`
	} `json:"author"`
	Committer struct {
		Name  string    `json:"name"`
		Email string    `json:"email"`
		Date  time.Time `json:"date"`
	} `json:"committer"`
	Comment string `json:"comment"`
	Url     string `json:"url"`
}

type AzuredevopsApiPullRequest

type AzuredevopsApiPullRequest struct {
	Labels []struct {
		Id     string `json:"id"`
		Name   string `json:"name"`
		Active bool   `json:"active"`
	} `json:"labels"`
	Repository struct {
		Id      string `json:"id"`
		Name    string `json:"name"`
		Url     string `json:"url"`
		Project struct {
			Id             string `json:"id"`
			Name           string `json:"name"`
			State          string `json:"state"`
			Visibility     string `json:"visibility"`
			LastUpdateTime string `json:"lastUpdateTime"`
		} `json:"project"`
	} `json:"repository"`
	PullRequestId int    `json:"pullRequestId"`
	CodeReviewId  int    `json:"codeReviewId"`
	Status        string `json:"status"`
	CreatedBy     struct {
		DisplayName string `json:"displayName"`
		Url         string `json:"url"`
		Id          string `json:"id"`
		UniqueName  string `json:"uniqueName"`
		ImageUrl    string `json:"imageUrl"`
		Descriptor  string `json:"descriptor"`
	} `json:"createdBy"`
	AzuredevopsCreationDate *common.Iso8601Time `json:"creationDate"`
	ClosedDate              *common.Iso8601Time `json:"closedDate"`
	Title                   string              `json:"title"`
	Description             string              `json:"description"`
	SourceRefName           string              `json:"sourceRefName"`
	TargetRefName           string              `json:"targetRefName"`
	MergeStatus             string              `json:"mergeStatus"`
	IsDraft                 bool                `json:"isDraft"`
	MergeId                 string              `json:"mergeId"`
	LastMergeSourceCommit   struct {
		CommitId string `json:"commitId"`
		Url      string `json:"url"`
	} `json:"lastMergeSourceCommit"`
	LastMergeTargetCommit struct {
		CommitId string `json:"commitId"`
		Url      string `json:"url"`
	} `json:"lastMergeTargetCommit"`
	LastMergeCommit struct {
		CommitId string `json:"commitId"`
		Url      string `json:"url"`
	} `json:"lastMergeCommit"`
	Url                 string     `json:"url"`
	SupportsIterations  bool       `json:"supportsIterations"`
	CompletionQueueTime *time.Time `json:"completionQueueTime"`
}

type AzuredevopsApiTimelineRecord

type AzuredevopsApiTimelineRecord struct {
	Id           string     `json:"id"`
	ParentId     string     `json:"parentId"`
	Type         string     `json:"type"`
	Name         string     `json:"name"`
	StartTime    *time.Time `json:"startTime"`
	FinishTime   *time.Time `json:"finishTime"`
	State        string     `json:"state"`
	Result       string     `json:"result"`
	ResultCode   string     `json:"resultCode"`
	ChangeId     int        `json:"changeId"`
	LastModified string     `json:"lastModified"`
	Identifier   string     `json:"identifier"`
}

type AzuredevopsApiUser

type AzuredevopsApiUser struct {
	SubjectKind    string `json:"subjectKind"`
	MetaType       string `json:"metaType"`
	DirectoryAlias string `json:"directoryAlias"`
	Domain         string `json:"domain"`
	PrincipalName  string `json:"principalName"`
	MailAddress    string `json:"mailAddress"`
	Origin         string `json:"origin"`
	OriginId       string `json:"originId"`
	DisplayName    string `json:"displayName"`
	Url            string `json:"url"`
	Descriptor     string `json:"descriptor"`
}

func (AzuredevopsApiUser) ToModel

func (u AzuredevopsApiUser) ToModel() AzuredevopsUser

type AzuredevopsBuild

type AzuredevopsBuild struct {
	common.NoPKModel

	ConnectionId  uint64 `gorm:"primaryKey"`
	AzuredevopsId int    `json:"id" gorm:"primaryKey"`
	RepositoryId  string
	Status        string
	Result        string
	Name          string
	SourceBranch  string
	SourceVersion string
	// Tags is a string version of the APIs tags array that helps to identify
	// devops.CICDPipeline's environment and type.
	Tags       string
	QueueTime  *time.Time
	StartTime  *time.Time
	FinishTime *time.Time
}

func (AzuredevopsBuild) TableName

func (AzuredevopsBuild) TableName() string

type AzuredevopsCommit

type AzuredevopsCommit struct {
	common.NoPKModel

	Sha            string `gorm:"primaryKey;type:varchar(40)"`
	Message        string
	AuthorName     string
	AuthorEmail    string
	AuthoredDate   *time.Time
	CommitterName  string
	CommitterEmail string
	CommittedDate  *time.Time
	WebUrl         string
	Additions      int
	Deletions      int
	Edit           int
}

func (AzuredevopsCommit) TableName

func (AzuredevopsCommit) TableName() string

type AzuredevopsConn

type AzuredevopsConn struct {
	//api.RestConnection `mapstructure:",squash"`
	AzuredevopsAccessToken `mapstructure:",squash"`
	Organization           string
	//Endpoint         string `mapstructure:"endpoint" json:"endpoint"`
	Proxy string `mapstructure:"proxy" json:"proxy"`
}

AzuredevopsConn holds the essential information to connect to the Azure DevOps API

func (*AzuredevopsConn) GetEndpoint

func (conn *AzuredevopsConn) GetEndpoint() string

func (*AzuredevopsConn) GetProxy

func (conn *AzuredevopsConn) GetProxy() string

func (*AzuredevopsConn) GetRateLimitPerHour

func (conn *AzuredevopsConn) GetRateLimitPerHour() int

func (*AzuredevopsConn) Sanitize

func (conn *AzuredevopsConn) Sanitize() AzuredevopsConn

type AzuredevopsConnection

type AzuredevopsConnection struct {
	api.BaseConnection `mapstructure:",squash"`
	AzuredevopsConn    `mapstructure:",squash"`
}

AzuredevopsConnection holds AzuredevopsConn plus ID/Name for database storage

func (AzuredevopsConnection) GetEndpoint

func (c AzuredevopsConnection) GetEndpoint() string

func (AzuredevopsConnection) GetProxy

func (c AzuredevopsConnection) GetProxy() string

func (AzuredevopsConnection) GetRateLimitPerHour

func (c AzuredevopsConnection) GetRateLimitPerHour() int

func (AzuredevopsConnection) Sanitize

func (AzuredevopsConnection) TableName

func (AzuredevopsConnection) TableName() string

type AzuredevopsPrCommit

type AzuredevopsPrCommit struct {
	common.NoPKModel

	CommitSha     string `gorm:"primaryKey"`
	ConnectionId  uint64 `gorm:"primaryKey"`
	PullRequestId int    `gorm:"primaryKey"`
	AuthorDate    *time.Time
	AuthorName    string
	AuthorEmail   string
}

func (AzuredevopsPrCommit) TableName

func (AzuredevopsPrCommit) TableName() string

type AzuredevopsPrLabel

type AzuredevopsPrLabel struct {
	common.NoPKModel

	ConnectionId  uint64 `gorm:"primaryKey"`
	PullRequestId int    `gorm:"primaryKey"`
	LabelName     string `gorm:"primaryKey"`
}

func (AzuredevopsPrLabel) TableName

func (AzuredevopsPrLabel) TableName() string

type AzuredevopsProject

type AzuredevopsProject struct {
	common.Scope `mapstructure:",squash" gorm:"embedded"`

	AzuredevopsId  string             `json:"id"`
	Name           string             `json:"name"`
	Description    string             `json:"description"`
	Url            string             `json:"url"`
	State          string             `json:"state"`
	Revision       int                `json:"revision"`
	Visibility     string             `json:"visibility"`
	LastUpdateTime common.Iso8601Time `json:"lastUpdateTime"`
}

func (AzuredevopsProject) ScopeFullName

func (a AzuredevopsProject) ScopeFullName() string

func (AzuredevopsProject) ScopeId

func (a AzuredevopsProject) ScopeId() string

func (AzuredevopsProject) ScopeName

func (a AzuredevopsProject) ScopeName() string

func (AzuredevopsProject) ScopeParams

func (a AzuredevopsProject) ScopeParams() interface{}

func (AzuredevopsProject) TableName

func (a AzuredevopsProject) TableName() string

type AzuredevopsPullRequest

type AzuredevopsPullRequest struct {
	common.NoPKModel

	ConnectionId    uint64 `gorm:"primaryKey"`
	AzuredevopsId   int    `gorm:"primaryKey"`
	RepositoryId    string
	CreationDate    *time.Time
	MergeCommitSha  string
	TargetRefName   string
	Description     string
	Status          string
	SourceRefName   string
	SourceCommitSha string
	TargetCommitSha string
	Type            string
	CreatedById     string
	CreatedByName   string
	ClosedDate      *time.Time
	Title           string
	ForkRepoId      string
	Url             string
}

func (AzuredevopsPullRequest) TableName

func (AzuredevopsPullRequest) TableName() string

type AzuredevopsRepo

type AzuredevopsRepo struct {
	common.Scope  `mapstructure:",squash"`
	AzureDevOpsPK `mapstructure:",squash"`

	Id        string `json:"id" validate:"required" mapstructure:"id" gorm:"primaryKey"`
	Name      string `json:"name" mapstructure:"name,omitempty"`
	Url       string `json:"url" mapstructure:"url,omitempty"`
	RemoteUrl string `json:"remoteUrl"`
	IsFork    bool
}

func (AzuredevopsRepo) ScopeFullName

func (repo AzuredevopsRepo) ScopeFullName() string

func (AzuredevopsRepo) ScopeId

func (repo AzuredevopsRepo) ScopeId() string

func (AzuredevopsRepo) ScopeName

func (repo AzuredevopsRepo) ScopeName() string

func (AzuredevopsRepo) ScopeParams

func (repo AzuredevopsRepo) ScopeParams() interface{}

func (AzuredevopsRepo) TableName

func (AzuredevopsRepo) TableName() string

type AzuredevopsRepoCommit

type AzuredevopsRepoCommit struct {
	common.NoPKModel

	ConnectionId uint64 `gorm:"primaryKey"`
	RepositoryId string `gorm:"primaryKey"`
	CommitSha    string `gorm:"primaryKey"`
}

func (AzuredevopsRepoCommit) TableName

func (AzuredevopsRepoCommit) TableName() string

type AzuredevopsScopeConfig

type AzuredevopsScopeConfig struct {
	common.ScopeConfig `mapstructure:",squash" json:",inline"`

	DeploymentPattern string            `mapstructure:"deploymentPattern,omitempty" json:"deploymentPattern"`
	ProductionPattern string            `mapstructure:"productionPattern,omitempty" json:"productionPattern"`
	Refdiff           datatypes.JSONMap `mapstructure:"refdiff,omitempty" json:"refdiff" swaggertype:"object" format:"json"`
}

func (AzuredevopsScopeConfig) GetConnectionId

func (sc AzuredevopsScopeConfig) GetConnectionId() uint64

GetConnectionId implements plugin.ToolLayerScopeConfig.

func (AzuredevopsScopeConfig) TableName

func (AzuredevopsScopeConfig) TableName() string

type AzuredevopsTimelineRecord

type AzuredevopsTimelineRecord struct {
	common.NoPKModel

	ConnectionId uint64 `gorm:"primaryKey"`
	RecordId     string `gorm:"primaryKey"`
	BuildId      int    `gorm:"primaryKey"`
	ParentId     string
	Type         string
	Name         string
	StartTime    *time.Time
	FinishTime   *time.Time
	State        string
	Result       string
	ChangeId     int
	LastModified string
}

func (AzuredevopsTimelineRecord) TableName

func (AzuredevopsTimelineRecord) TableName() string

type AzuredevopsUser

type AzuredevopsUser struct {
	common.NoPKModel

	ConnectionId  uint64 `gorm:"primaryKey"`
	AzuredevopsId string `gorm:"primaryKey"`
	Origin        string
	Descriptor    string
	PrincipalName string
	MailAddress   string
	DisplayName   string
	Url           string
}

func (AzuredevopsUser) TableName

func (AzuredevopsUser) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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