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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitbucketServerApiParams

type BitbucketServerApiParams struct {
	ConnectionId uint64
	FullName     string
}

type BitbucketServerApiRepo

type BitbucketServerApiRepo struct {
	Id            int32  `json:"id"`
	Name          string `json:"name"`
	Slug          string `json:"slug"`
	HierarchyId   string `json:"hierarchyId"`
	State         string `json:"state"`
	StatusMessage string `json:"statusMessage"`
	Description   string `json:"description"`
	Public        bool   `json:"public"`
	Archived      bool   `json:"archived"`
	// CreatedAt     *time.Time  `json:"created_on"`
	// UpdatedAt     *time.Time  `json:"updated_on"`
	Project ProjectItem `json:"project"`
	Links   struct {
		Clone []struct {
			Href string `json:"href"`
			Name string `json:"name"`
		} `json:"clone"`
		Self []struct {
			Href string `json:"href"`
		}
	} `json:"links"`
}

func (BitbucketServerApiRepo) ConvertApiScope

func (b BitbucketServerApiRepo) ConvertApiScope() plugin.ToolLayerScope

type BitbucketServerConn

type BitbucketServerConn struct {
	api.RestConnection `mapstructure:",squash"`
	api.BasicAuth      `mapstructure:",squash"`
}

BitbucketServerConn holds the essential information to connect to the Bitbucket API

func (BitbucketServerConn) Sanitize

func (connection BitbucketServerConn) Sanitize() BitbucketServerConn

type BitbucketServerConnection

type BitbucketServerConnection struct {
	api.BaseConnection  `mapstructure:",squash"`
	BitbucketServerConn `mapstructure:",squash"`
}

BitbucketServerConnection holds BitbucketServerConn plus ID/Name for database storage

func (BitbucketServerConnection) Sanitize

func (BitbucketServerConnection) TableName

func (BitbucketServerConnection) TableName() string

type BitbucketServerPrComment

type BitbucketServerPrComment struct {
	ConnectionId  uint64 `gorm:"primaryKey"`
	BitbucketId   int    `gorm:"primaryKey"`
	RepoId        string `gorm:"index:pr"` // PullRequestId is not unique across multiple repos of a connection
	PullRequestId int    `gorm:"index:pr"`
	AuthorId      int
	AuthorName    string `gorm:"type:varchar(255)"`
	CreatedAt     time.Time
	UpdatedAt     *time.Time
	Body          string
	common.NoPKModel
}

func (BitbucketServerPrComment) TableName

func (BitbucketServerPrComment) TableName() string

type BitbucketServerPrCommit

type BitbucketServerPrCommit struct {
	ConnectionId       uint64 `gorm:"primaryKey"`
	RepoId             string `gorm:"primaryKey"` // PullRequestId is not unique across multiple repos of a connection
	PullRequestId      int    `gorm:"primaryKey;autoIncrement:false"`
	CommitSha          string `gorm:"primaryKey;type:varchar(40)"`
	CommitAuthorName   string
	CommitAuthorEmail  string
	CommitAuthoredDate time.Time
	common.NoPKModel
}

func (BitbucketServerPrCommit) TableName

func (BitbucketServerPrCommit) TableName() string

type BitbucketServerPullRequest

type BitbucketServerPullRequest struct {
	ConnectionId             uint64 `gorm:"primaryKey"`
	RepoId                   string `gorm:"primaryKey;type:varchar(255)"`
	BitbucketId              int    `gorm:"primaryKey"`
	Number                   int    `gorm:"index"` // This number is used in GET requests to the API associated to reviewers / comments / etc.
	BaseRepoId               string
	HeadRepoId               string
	State                    string `gorm:"type:varchar(255)"`
	Title                    string
	Description              string
	BitbucketServerCreatedAt time.Time
	BitbucketServerUpdatedAt time.Time `gorm:"index"`
	ClosedAt                 *time.Time
	CommentCount             int
	Commits                  int
	MergedAt                 *time.Time
	Body                     string
	Type                     string `gorm:"type:varchar(255)"`
	Component                string `gorm:"type:varchar(255)"`
	MergeCommitSha           string `gorm:"type:varchar(40)"`
	HeadRef                  string `gorm:"type:varchar(255)"`
	BaseRef                  string `gorm:"type:varchar(255)"`
	BaseCommitSha            string `gorm:"type:varchar(255)"`
	HeadCommitSha            string `gorm:"type:varchar(255)"`
	Url                      string `gorm:"type:varchar(255)"`
	AuthorName               string `gorm:"type:varchar(255)"`
	AuthorId                 int
	common.NoPKModel
}

func (BitbucketServerPullRequest) TableName

func (BitbucketServerPullRequest) TableName() string

type BitbucketServerRepo

type BitbucketServerRepo struct {
	common.Scope `mapstructure:",squash"`
	BitbucketId  string     `json:"bitbucketId" gorm:"primaryKey;type:varchar(255)" validate:"required" mapstructure:"bitbucketId"`
	Name         string     `json:"name" gorm:"type:varchar(255)" mapstructure:"name,omitempty"`
	HTMLUrl      string     `json:"HTMLUrl" gorm:"type:varchar(255)" mapstructure:"HTMLUrl,omitempty"`
	Description  string     `json:"description" mapstructure:"description,omitempty"`
	CloneUrl     string     `json:"cloneUrl" gorm:"type:varchar(255)" mapstructure:"cloneUrl,omitempty"`
	CreatedDate  *time.Time `json:"createdDate" mapstructure:"-"`
	UpdatedDate  *time.Time `json:"updatedDate" mapstructure:"-"`
}

func (BitbucketServerRepo) ScopeFullName

func (p BitbucketServerRepo) ScopeFullName() string

func (BitbucketServerRepo) ScopeId

func (p BitbucketServerRepo) ScopeId() string

func (BitbucketServerRepo) ScopeName

func (p BitbucketServerRepo) ScopeName() string

func (BitbucketServerRepo) ScopeParams

func (p BitbucketServerRepo) ScopeParams() interface{}

func (BitbucketServerRepo) TableName

func (BitbucketServerRepo) TableName() string

type BitbucketServerScopeConfig

type BitbucketServerScopeConfig struct {
	common.ScopeConfig `mapstructure:",squash" json:",inline" gorm:"embedded"`
	Name               string `mapstructure:"name" json:"name" gorm:"type:varchar(255);index:idx_name_github,unique" validate:"required"`
	PrType             string `mapstructure:"prType,omitempty" json:"prType" gorm:"type:varchar(255)"`
	PrComponent        string `mapstructure:"prComponent,omitempty" json:"prComponent" gorm:"type:varchar(255)"`
	PrBodyClosePattern string `mapstructure:"prBodyClosePattern,omitempty" json:"prBodyClosePattern" gorm:"type:varchar(255)"`

	// DeploymentPattern  string            `mapstructure:"deploymentPattern,omitempty" json:"deploymentPattern" gorm:"type:varchar(255)"`
	// ProductionPattern  string            `mapstructure:"productionPattern,omitempty" json:"productionPattern" gorm:"type:varchar(255)"`
	Refdiff datatypes.JSONMap `mapstructure:"refdiff,omitempty" json:"refdiff" swaggertype:"object" format:"json"`
}

func (*BitbucketServerScopeConfig) SetConnectionId

func (cfg *BitbucketServerScopeConfig) SetConnectionId(c *BitbucketServerScopeConfig, connectionId uint64)

func (BitbucketServerScopeConfig) TableName

func (BitbucketServerScopeConfig) TableName() string

type BitbucketServerUser

type BitbucketServerUser struct {
	ConnectionId  uint64  `gorm:"primaryKey"`
	BitbucketId   int     `gorm:"primaryKey"`
	Name          string  `gorm:"type:varchar(255)"`
	EmailAddress  string  `gorm:"type:varchar(255)"`
	Active        bool    `gorm:"type:boolean"`
	Slug          string  `gorm:"type:varchar(255)"`
	Type          string  `gorm:"type:varchar(255)"`
	AccountStatus string  `gorm:"type:varchar(255)"`
	DisplayName   string  `gorm:"type:varchar(255)"`
	HtmlUrl       *string `gorm:"type:varchar(255)"`
	common.NoPKModel
}

func (BitbucketServerUser) TableName

func (BitbucketServerUser) TableName() string

type PaginationResponse

type PaginationResponse[T any] struct {
	Start         int  `json:"start"`
	Limit         int  `json:"limit"`
	Size          int  `json:"size"`
	IsLastPage    bool `json:"isLastPage"`
	NextPageStart *int `json:"nextPageStart"`
	Values        []T  `json:"values"`
}

type ProjectItem

type ProjectItem struct {
	Key    string `json:"key" group:"id"`
	Name   string `json:"name" group:"name"`
	Public bool   `json:"public"`
	Type   string `json:"type"`
	Id     int32  `json:"id"`
}

func (ProjectItem) GroupId

func (p ProjectItem) GroupId() string

func (ProjectItem) GroupName

func (p ProjectItem) GroupName() string

type ProjectsResponse

type ProjectsResponse PaginationResponse[ProjectItem]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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