models

package
v0.0.0-...-8b85423 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate()

Types

type Commit

type Commit struct {
	gorm.Model
	Date            *time.Time `gorm:"index"`
	GitlabId        string     `gorm:"uniqueIndex"`
	ShortID         string     `gorm:"index"`
	Title           string
	AuthorName      string
	AuthorEmail     string
	AuthoredDate    *time.Time
	CommitterName   string
	CommitterEmail  string
	CommittedDate   *time.Time
	GitlabCreatedAt *time.Time
	Message         string
	Stats           CommitStats `gorm:"embedded;embeddedPrefix:stats_"`
	Status          string
	ProjectID       int
	WebURL          string
}

func (Commit) AddOrUpdate

func (c Commit) AddOrUpdate(commit *gitlab.Commit, date *time.Time)

func (Commit) QueryStats

func (c Commit) QueryStats(date *time.Time) map[string]UserCommitStats

type CommitStats

type CommitStats struct {
	Additions int
	Deletions int
	Total     int
}

type ContainerExpirationPolicy

type ContainerExpirationPolicy struct {
	Cadence         string
	KeepN           int
	OlderThan       string
	NameRegexDelete string
	NameRegexKeep   string
	Enabled         bool
	NextRunAt       *time.Time
}

type CustomAttribute

type CustomAttribute struct {
	Key   string
	Value string
}

type ForkParent

type ForkParent struct {
	HTTPURLToRepo     string
	ID                int
	Name              string
	NameWithNamespace string
	Path              string
	PathWithNamespace string
	WebURL            string
}
type Links struct {
	Self          string
	Issues        string
	MergeRequests string
	RepoBranches  string
	Labels        string
	Events        string
	Members       string
}

type Project

type Project struct {
	gorm.Model
	GitlabId                       int
	Description                    string
	DefaultBranch                  string
	Public                         bool
	Visibility                     string
	SSHURLToRepo                   string
	HTTPURLToRepo                  string
	WebURL                         string
	ReadmeURL                      string
	TagList                        string
	Topics                         string
	OwnerId                        int
	Name                           string
	NameWithNamespace              string
	Path                           string
	PathWithNamespace              string
	IssuesEnabled                  bool
	OpenIssuesCount                int
	MergeRequestsEnabled           bool
	ApprovalsBeforeMerge           int
	JobsEnabled                    bool
	WikiEnabled                    bool
	SnippetsEnabled                bool
	ResolveOutdatedDiffDiscussions bool
	ContainerExpirationPolicy      ContainerExpirationPolicy `gorm:"embedded;embeddedPrefix:container_"`
	ContainerRegistryEnabled       bool
	ContainerRegistryAccessLevel   string
	GitlabCreatedAt                *time.Time
	LastActivityAt                 *time.Time
	CreatorID                      int
	Namespace                      ProjectNamespace `gorm:"embedded;embeddedPrefix:namespace_"`
	ImportStatus                   string
	ImportError                    string
	//Permissions                               *Permissions
	//MarkedForDeletionAt                       *ISOTime
	EmptyRepo                                 bool
	Archived                                  bool
	AvatarURL                                 string
	LicenseURL                                string
	License                                   ProjectLicense `gorm:"embedded;embeddedPrefix:project_license_"`
	SharedRunnersEnabled                      bool
	ForksCount                                int
	StarCount                                 int
	RunnersToken                              string
	PublicBuilds                              bool
	AllowMergeOnSkippedPipeline               bool
	OnlyAllowMergeIfPipelineSucceeds          bool
	OnlyAllowMergeIfAllDiscussionsAreResolved bool
	RemoveSourceBranchAfterMerge              bool
	PrintingMergeRequestLinkEnabled           bool
	LFSEnabled                                bool
	RepositoryStorage                         string
	RequestAccessEnabled                      bool
	MergeMethod                               string
	ForkedFromProject                         ForkParent `gorm:"embedded;embeddedPrefix:fork_parent_"`
	Mirror                                    bool
	MirrorUserID                              int
	MirrorTriggerBuilds                       bool
	OnlyMirrorProtectedBranches               bool
	MirrorOverwritesDivergedBranches          bool
	PackagesEnabled                           bool
	ServiceDeskEnabled                        bool
	ServiceDeskAddress                        string
	IssuesAccessLevel                         string
	RepositoryAccessLevel                     string
	MergeRequestsAccessLevel                  string
	ForkingAccessLevel                        string
	WikiAccessLevel                           string
	BuildsAccessLevel                         string
	SnippetsAccessLevel                       string
	PagesAccessLevel                          string
	OperationsAccessLevel                     string
	AnalyticsAccessLevel                      string
	AutocloseReferencedIssues                 bool
	SuggestionCommitMessage                   string
	AutoCancelPendingPipelines                string
	CIForwardDeploymentEnabled                bool
	SquashOption                              string
	//SharedWithGroups                          []struct {
	//	GroupID          int    `json:"group_id"`
	//	GroupName        string `json:"group_name"`
	//	GroupAccessLevel int    `json:"group_access_level"`
	//} `json:"shared_with_groups"`
	Statistics        ProjectStatistics `gorm:"embedded;embeddedPrefix:statistics_"`
	Links             Links             `gorm:"embedded;embeddedPrefix:links_"`
	CIConfigPath      string
	CIDefaultGitDepth int
	//CustomAttributes                         []*CustomAttribute `gorm:"embedded;embeddedPrefix:custom_attributes_"`
	ComplianceFrameworks                     string
	BuildCoverageRegex                       string
	BuildTimeout                             int
	IssuesTemplate                           string
	MergeRequestsTemplate                    string
	KeepLatestArtifact                       bool
	MergePipelinesEnabled                    bool
	MergeTrainsEnabled                       bool
	RestrictUserDefinedVariables             bool
	MergeCommitTemplate                      string
	SquashCommitTemplate                     string
	AutoDevopsDeployStrategy                 string
	AutoDevopsEnabled                        bool
	BuildGitStrategy                         string
	EmailsDisabled                           bool
	ExternalAuthorizationClassificationLabel string
	RequirementsAccessLevel                  int
	SecurityAndComplianceAccessLevel         int
}

func (Project) AddOrUpdate

func (p Project) AddOrUpdate(project *gitlab.Project)

func (Project) QueryAll

func (p Project) QueryAll() []*Project

func (Project) QueryAllProjectId

func (p Project) QueryAllProjectId() []int

type ProjectLicense

type ProjectLicense struct {
	Key       string
	Name      string
	Nickname  string
	HTMLURL   string
	SourceURL string
}

type ProjectNamespace

type ProjectNamespace struct {
	ID        int
	Name      string
	Path      string
	Kind      string
	FullPath  string
	AvatarURL string
	WebURL    string
}

type ProjectStatistics

type ProjectStatistics struct {
	StorageStatistics
	CommitCount int
}

type StorageStatistics

type StorageStatistics struct {
	StorageSize      int64
	RepositorySize   int64
	LfsObjectsSize   int64
	JobArtifactsSize int64
}

type User

type User struct {
	gorm.Model
	GitlabId                       int    `gorm:"uniqueIndex"`
	Username                       string `gorm:"uniqueIndex"`
	Email                          string `gorm:"uniqueIndex"`
	Name                           string
	State                          string
	WebURL                         string
	GitlabCreatedAt                *time.Time
	Bio                            string
	Location                       string
	PublicEmail                    string
	Skype                          string
	Linkedin                       string
	Twitter                        string
	WebsiteURL                     string
	Organization                   string
	JobTitle                       string
	ExternUID                      string
	Provider                       string
	ThemeID                        int
	LastActivityOn                 *time.Time
	ColorSchemeID                  int
	IsAdmin                        bool
	AvatarURL                      string
	CanCreateGroup                 bool
	CanCreateProject               bool
	ProjectsLimit                  int
	CurrentSignInAt                *time.Time
	CurrentSignInIP                string
	LastSignInAt                   *time.Time
	LastSignInIP                   string
	ConfirmedAt                    *time.Time
	TwoFactorEnabled               bool
	Note                           string
	External                       bool
	PrivateProfile                 bool
	SharedRunnersMinutesLimit      int
	ExtraSharedRunnersMinutesLimit int
	UsingLicenseSeat               bool
}

func (User) AddOrUpdate

func (u User) AddOrUpdate(user *gitlab.User)

func (User) Query

func (u User) Query(gitlabId int) *User

func (User) QueryAll

func (u User) QueryAll() []*User

func (User) QueryByEmail

func (u User) QueryByEmail(email string) *User

type UserCommitStats

type UserCommitStats struct {
	CommitStats
	CommitCnt  int
	CommitDate string
}

Jump to

Keyboard shortcuts

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