v1

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUsernameAndRepoNameFromBitbucketRepositoryUrl

func GetUsernameAndRepoNameFromBitbucketRepositoryUrl(url string) (username string, repoName string)

func GetUsernameAndRepoNameFromGithubRepositoryUrl

func GetUsernameAndRepoNameFromGithubRepositoryUrl(url string) (username string, repoName string)

Types

type Agent

type Agent struct {
	Name            string `bson:"name" json:"name"`
	ApiVersion      string `bson:"api_version" json:"api_version"`
	TerminalBaseUrl string `bson:"terminal_base_url" json:"terminal_base_url"`
}

Agent contains payload data

type Application

type Application struct {
	MetaData ApplicationMetadata  `bson:"_metadata" json:"_metadata"`
	Url      string               `bson:"url" json:"url"`
	Webhook  GitWebhook           `bson:"webhook" json:"webhook"`
	Status   enums.COMPANY_STATUS `bson:"status" json:"status"`
}

Application contains application info

func RemoveApplication

func RemoveApplication(s []Application, i int) []Application

RemoveApplication removes applications from a list by index

func (Application) Validate

func (application Application) Validate() error

Validate validates application info

type ApplicationMetadata

type ApplicationMetadata struct {
	Labels           map[string]string `bson:"labels" json:"labels"`
	Id               string            `bson:"id" json:"id"`
	Name             string            `bson:"name" json:"name"`
	IsWebhookEnabled bool              `bson:"is_webhook_enabled" json:"is_webhook_enabled"`
}

ApplicationMetadata contains application metadata info

func (ApplicationMetadata) Validate

func (metadata ApplicationMetadata) Validate() error

Validate validates application metadata

type ApplicationMetadataCollection

type ApplicationMetadataCollection struct {
	MetaData ApplicationMetadata  `bson:"_metadata" json:"_metadata"`
	Status   enums.COMPANY_STATUS `bson:"status" json:"status"`
}

ApplicationMetadataCollection contains application metadata collection info

type ApplicationMetadataCollections

type ApplicationMetadataCollections struct {
	ApplicationMetadataCollection []ApplicationMetadataCollection `bson:"application_metadata_collection" json:"application_metadata_collection"`
}

ApplicationMetadataCollectionsDto contains application metadata collections list

type ApplicationUpdateOption

type ApplicationUpdateOption struct {
	Option enums.APPLICATION_UPDATE_OPTION `json:"option"`
}

ApplicationUpdateOption contains applications update options

type ApplicationsDto

type ApplicationsDto struct {
	Applications []Application `bson:"applications" json:"applications"`
}

ApplicationsDto contains application list

type BitBucketBranches

type BitBucketBranches struct {
	Values []struct {
		Name string `json:"name"`
	} `json:"values"`
}

BitBucketBranches is a list of branches

type BitBucketCommits

type BitBucketCommits struct {
	Pagelen int `json:"pagelen"`
	Values  []struct {
		Rendered struct {
			Message struct {
				Raw    string `json:"raw"`
				Markup string `json:"markup"`
				HTML   string `json:"html"`
				Type   string `json:"type"`
			} `json:"message"`
		} `json:"rendered"`
		Hash       string `json:"hash"`
		Repository struct {
			Links struct {
				Self struct {
					Href string `json:"href"`
				} `json:"self"`
				HTML struct {
					Href string `json:"href"`
				} `json:"html"`
				Avatar struct {
					Href string `json:"href"`
				} `json:"avatar"`
			} `json:"links"`
			Type     string `json:"type"`
			Name     string `json:"name"`
			FullName string `json:"full_name"`
			UUID     string `json:"uuid"`
		} `json:"repository"`
		Links struct {
			Self struct {
				Href string `json:"href"`
			} `json:"self"`
			Comments struct {
				Href string `json:"href"`
			} `json:"comments"`
			Patch struct {
				Href string `json:"href"`
			} `json:"patch"`
			HTML struct {
				Href string `json:"href"`
			} `json:"html"`
			Diff struct {
				Href string `json:"href"`
			} `json:"diff"`
			Approve struct {
				Href string `json:"href"`
			} `json:"approve"`
			Statuses struct {
				Href string `json:"href"`
			} `json:"statuses"`
		} `json:"links"`
		Author struct {
			Raw  string `json:"raw"`
			Type string `json:"type"`
			User struct {
				DisplayName string `json:"display_name"`
				UUID        string `json:"uuid"`
				Links       struct {
					Self struct {
						Href string `json:"href"`
					} `json:"self"`
					HTML struct {
						Href string `json:"href"`
					} `json:"html"`
					Avatar struct {
						Href string `json:"href"`
					} `json:"avatar"`
				} `json:"links"`
				Type      string `json:"type"`
				Nickname  string `json:"nickname"`
				AccountID string `json:"account_id"`
			} `json:"user"`
		} `json:"author,omitempty"`
		Summary struct {
			Raw    string `json:"raw"`
			Markup string `json:"markup"`
			HTML   string `json:"html"`
			Type   string `json:"type"`
		} `json:"summary"`
		Parents []struct {
			Hash  string `json:"hash"`
			Type  string `json:"type"`
			Links struct {
				Self struct {
					Href string `json:"href"`
				} `json:"self"`
				HTML struct {
					Href string `json:"href"`
				} `json:"html"`
			} `json:"links"`
		} `json:"parents"`
		Date    time.Time `json:"date"`
		Message string    `json:"message"`
		Type    string    `json:"type"`
	} `json:"values"`
	Next string `json:"next"`
}

type BitbucketCreateWebhookRequest

type BitbucketCreateWebhookRequest struct {
	Description string   `json:"description"`
	URL         string   `json:"url"`
	Active      bool     `json:"active"`
	Events      []string `json:"events"`
}

BitbucketCreateWebhookRequest contains bitbucket web hook creation data

type BitbucketDirectoryContent

type BitbucketDirectoryContent struct {
	Pagelen int `json:"pagelen"`
	Values  []struct {
		Path   string `json:"path"`
		Type   string `json:"type"`
		Commit struct {
			Type  string `json:"type"`
			Hash  string `json:"hash"`
			Links struct {
				Self struct {
					Href string `json:"href"`
				} `json:"self"`
				HTML struct {
					Href string `json:"href"`
				} `json:"html"`
			} `json:"links"`
		} `json:"commit"`
		Mimetype interface{} `json:"mimetype,omitempty"`
		Links    struct {
			Self struct {
				Href string `json:"href"`
			} `json:"self"`
			Meta struct {
				Href string `json:"href"`
			} `json:"meta"`
			History struct {
				Href string `json:"href"`
			} `json:"history"`
		} `json:"links,omitempty"`
		EscapedPath string        `json:"escaped_path,omitempty"`
		Attributes  []interface{} `json:"attributes,omitempty"`
		Size        int           `json:"size,omitempty"`
	} `json:"values"`
	Page int `json:"page"`
}

BitbucketDirectoryContent contains bitbucket directory data

func (BitbucketDirectoryContent) GetGitDirectoryContent

func (directoryContent BitbucketDirectoryContent) GetGitDirectoryContent() GitDirectoryContent

GetGitDirectoryContent converts BitbucketDirectoryContent object to GitDirectoryContent object

type BitbucketRepository

type BitbucketRepository struct {
	Scm     string      `json:"scm"`
	Website interface{} `json:"website"`
	HasWiki bool        `json:"has_wiki"`
	UUID    string      `json:"uuid"`
	Links   struct {
		Watchers struct {
			Href string `json:"href"`
		} `json:"watchers"`
		Branches struct {
			Href string `json:"href"`
		} `json:"branches"`
		Tags struct {
			Href string `json:"href"`
		} `json:"tags"`
		Commits struct {
			Href string `json:"href"`
		} `json:"commits"`
		Clone []struct {
			Href string `json:"href"`
			Name string `json:"name"`
		} `json:"clone"`
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
		Source struct {
			Href string `json:"href"`
		} `json:"source"`
		HTML struct {
			Href string `json:"href"`
		} `json:"html"`
		Avatar struct {
			Href string `json:"href"`
		} `json:"avatar"`
		Hooks struct {
			Href string `json:"href"`
		} `json:"hooks"`
		Forks struct {
			Href string `json:"href"`
		} `json:"forks"`
		Downloads struct {
			Href string `json:"href"`
		} `json:"downloads"`
		Pullrequests struct {
			Href string `json:"href"`
		} `json:"pullrequests"`
	} `json:"links"`
	ForkPolicy string `json:"fork_policy"`
	FullName   string `json:"full_name"`
	Name       string `json:"name"`
	Project    struct {
		Links struct {
			Self struct {
				Href string `json:"href"`
			} `json:"self"`
			HTML struct {
				Href string `json:"href"`
			} `json:"html"`
			Avatar struct {
				Href string `json:"href"`
			} `json:"avatar"`
		} `json:"links"`
		Type string `json:"type"`
		Name string `json:"name"`
		Key  string `json:"key"`
		UUID string `json:"uuid"`
	} `json:"project"`
	Language   string    `json:"language"`
	CreatedOn  time.Time `json:"created_on"`
	Mainbranch struct {
		Type string `json:"type"`
		Name string `json:"name"`
	} `json:"mainbranch"`
	Workspace struct {
		Slug  string `json:"slug"`
		Type  string `json:"type"`
		Name  string `json:"name"`
		Links struct {
			Self struct {
				Href string `json:"href"`
			} `json:"self"`
			HTML struct {
				Href string `json:"href"`
			} `json:"html"`
			Avatar struct {
				Href string `json:"href"`
			} `json:"avatar"`
		} `json:"links"`
		UUID string `json:"uuid"`
	} `json:"workspace"`
	HasIssues bool `json:"has_issues"`
	Owner     struct {
		DisplayName string `json:"display_name"`
		UUID        string `json:"uuid"`
		Links       struct {
			Self struct {
				Href string `json:"href"`
			} `json:"self"`
			HTML struct {
				Href string `json:"href"`
			} `json:"html"`
			Avatar struct {
				Href string `json:"href"`
			} `json:"avatar"`
		} `json:"links"`
		Type      string `json:"type"`
		Nickname  string `json:"nickname"`
		AccountID string `json:"account_id"`
	} `json:"owner"`
	UpdatedOn   time.Time `json:"updated_on"`
	Size        int       `json:"size"`
	Type        string    `json:"type"`
	Slug        string    `json:"slug"`
	IsPrivate   bool      `json:"is_private"`
	Description string    `json:"description"`
}

BitbucketRepository contains bitbucket repository information

type BitbucketWebHookEvent

type BitbucketWebHookEvent struct {
	Push struct {
		Changes []struct {
			Forced bool `json:"forced"`
			Old    struct {
				Name  string `json:"name"`
				Links struct {
					Commits struct {
						Href string `json:"href"`
					} `json:"commits"`
					Self struct {
						Href string `json:"href"`
					} `json:"self"`
					HTML struct {
						Href string `json:"href"`
					} `json:"html"`
				} `json:"links"`
				DefaultMergeStrategy string   `json:"default_merge_strategy"`
				MergeStrategies      []string `json:"merge_strategies"`
				Type                 string   `json:"type"`
				Target               struct {
					Rendered struct {
					} `json:"rendered"`
					Hash  string `json:"hash"`
					Links struct {
						Self struct {
							Href string `json:"href"`
						} `json:"self"`
						HTML struct {
							Href string `json:"href"`
						} `json:"html"`
					} `json:"links"`
					Author struct {
						Raw  string `json:"raw"`
						Type string `json:"type"`
						User struct {
							DisplayName string `json:"display_name"`
							UUID        string `json:"uuid"`
							Links       struct {
								Self struct {
									Href string `json:"href"`
								} `json:"self"`
								HTML struct {
									Href string `json:"href"`
								} `json:"html"`
								Avatar struct {
									Href string `json:"href"`
								} `json:"avatar"`
							} `json:"links"`
							Type      string `json:"type"`
							Nickname  string `json:"nickname"`
							AccountID string `json:"account_id"`
						} `json:"user"`
					} `json:"author"`
					Summary struct {
						Raw    string `json:"raw"`
						Markup string `json:"markup"`
						HTML   string `json:"html"`
						Type   string `json:"type"`
					} `json:"summary"`
					Parents []struct {
						Hash  string `json:"hash"`
						Type  string `json:"type"`
						Links struct {
							Self struct {
								Href string `json:"href"`
							} `json:"self"`
							HTML struct {
								Href string `json:"href"`
							} `json:"html"`
						} `json:"links"`
					} `json:"parents"`
					Date       time.Time `json:"date"`
					Message    string    `json:"message"`
					Type       string    `json:"type"`
					Properties struct {
					} `json:"properties"`
				} `json:"target"`
			} `json:"old"`
			Links struct {
				Commits struct {
					Href string `json:"href"`
				} `json:"commits"`
				HTML struct {
					Href string `json:"href"`
				} `json:"html"`
				Diff struct {
					Href string `json:"href"`
				} `json:"diff"`
			} `json:"links"`
			Created bool `json:"created"`
			Commits []struct {
				Rendered struct {
				} `json:"rendered"`
				Hash  string `json:"hash"`
				Links struct {
					Self struct {
						Href string `json:"href"`
					} `json:"self"`
					Comments struct {
						Href string `json:"href"`
					} `json:"comments"`
					Patch struct {
						Href string `json:"href"`
					} `json:"patch"`
					HTML struct {
						Href string `json:"href"`
					} `json:"html"`
					Diff struct {
						Href string `json:"href"`
					} `json:"diff"`
					Approve struct {
						Href string `json:"href"`
					} `json:"approve"`
					Statuses struct {
						Href string `json:"href"`
					} `json:"statuses"`
				} `json:"links"`
				Author struct {
					Raw  string `json:"raw"`
					Type string `json:"type"`
					User struct {
						DisplayName string `json:"display_name"`
						UUID        string `json:"uuid"`
						Links       struct {
							Self struct {
								Href string `json:"href"`
							} `json:"self"`
							HTML struct {
								Href string `json:"href"`
							} `json:"html"`
							Avatar struct {
								Href string `json:"href"`
							} `json:"avatar"`
						} `json:"links"`
						Type      string `json:"type"`
						Nickname  string `json:"nickname"`
						AccountID string `json:"account_id"`
					} `json:"user"`
				} `json:"author"`
				Summary struct {
					Raw    string `json:"raw"`
					Markup string `json:"markup"`
					HTML   string `json:"html"`
					Type   string `json:"type"`
				} `json:"summary"`
				Parents []struct {
					Hash  string `json:"hash"`
					Type  string `json:"type"`
					Links struct {
						Self struct {
							Href string `json:"href"`
						} `json:"self"`
						HTML struct {
							Href string `json:"href"`
						} `json:"html"`
					} `json:"links"`
				} `json:"parents"`
				Date       time.Time `json:"date"`
				Message    string    `json:"message"`
				Type       string    `json:"type"`
				Properties struct {
				} `json:"properties"`
			} `json:"commits"`
			Truncated bool `json:"truncated"`
			Closed    bool `json:"closed"`
			New       struct {
				Name  string `json:"name"`
				Links struct {
					Commits struct {
						Href string `json:"href"`
					} `json:"commits"`
					Self struct {
						Href string `json:"href"`
					} `json:"self"`
					HTML struct {
						Href string `json:"href"`
					} `json:"html"`
				} `json:"links"`
				DefaultMergeStrategy string   `json:"default_merge_strategy"`
				MergeStrategies      []string `json:"merge_strategies"`
				Type                 string   `json:"type"`
				Target               struct {
					Rendered struct {
					} `json:"rendered"`
					Hash  string `json:"hash"`
					Links struct {
						Self struct {
							Href string `json:"href"`
						} `json:"self"`
						HTML struct {
							Href string `json:"href"`
						} `json:"html"`
					} `json:"links"`
					Author struct {
						Raw  string `json:"raw"`
						Type string `json:"type"`
						User struct {
							DisplayName string `json:"display_name"`
							UUID        string `json:"uuid"`
							Links       struct {
								Self struct {
									Href string `json:"href"`
								} `json:"self"`
								HTML struct {
									Href string `json:"href"`
								} `json:"html"`
								Avatar struct {
									Href string `json:"href"`
								} `json:"avatar"`
							} `json:"links"`
							Type      string `json:"type"`
							Nickname  string `json:"nickname"`
							AccountID string `json:"account_id"`
						} `json:"user"`
					} `json:"author"`
					Summary struct {
						Raw    string `json:"raw"`
						Markup string `json:"markup"`
						HTML   string `json:"html"`
						Type   string `json:"type"`
					} `json:"summary"`
					Parents []struct {
						Hash  string `json:"hash"`
						Type  string `json:"type"`
						Links struct {
							Self struct {
								Href string `json:"href"`
							} `json:"self"`
							HTML struct {
								Href string `json:"href"`
							} `json:"html"`
						} `json:"links"`
					} `json:"parents"`
					Date       time.Time `json:"date"`
					Message    string    `json:"message"`
					Type       string    `json:"type"`
					Properties struct {
					} `json:"properties"`
				} `json:"target"`
			} `json:"new"`
		} `json:"changes"`
	} `json:"push"`
	Actor struct {
		DisplayName string `json:"display_name"`
		UUID        string `json:"uuid"`
		Links       struct {
			Self struct {
				Href string `json:"href"`
			} `json:"self"`
			HTML struct {
				Href string `json:"href"`
			} `json:"html"`
			Avatar struct {
				Href string `json:"href"`
			} `json:"avatar"`
		} `json:"links"`
		Type      string `json:"type"`
		Nickname  string `json:"nickname"`
		AccountID string `json:"account_id"`
	} `json:"actor"`
	Repository struct {
		Scm     string      `json:"scm"`
		Website interface{} `json:"website"`
		UUID    string      `json:"uuid"`
		Links   struct {
			Self struct {
				Href string `json:"href"`
			} `json:"self"`
			HTML struct {
				Href string `json:"href"`
			} `json:"html"`
			Avatar struct {
				Href string `json:"href"`
			} `json:"avatar"`
		} `json:"links"`
		Project struct {
			Links struct {
				Self struct {
					Href string `json:"href"`
				} `json:"self"`
				HTML struct {
					Href string `json:"href"`
				} `json:"html"`
				Avatar struct {
					Href string `json:"href"`
				} `json:"avatar"`
			} `json:"links"`
			Type string `json:"type"`
			Name string `json:"name"`
			Key  string `json:"key"`
			UUID string `json:"uuid"`
		} `json:"project"`
		FullName string `json:"full_name"`
		Owner    struct {
			DisplayName string `json:"display_name"`
			UUID        string `json:"uuid"`
			Links       struct {
				Self struct {
					Href string `json:"href"`
				} `json:"self"`
				HTML struct {
					Href string `json:"href"`
				} `json:"html"`
				Avatar struct {
					Href string `json:"href"`
				} `json:"avatar"`
			} `json:"links"`
			Type      string `json:"type"`
			Nickname  string `json:"nickname"`
			AccountID string `json:"account_id"`
		} `json:"owner"`
		Workspace struct {
			Slug  string `json:"slug"`
			Type  string `json:"type"`
			Name  string `json:"name"`
			Links struct {
				Self struct {
					Href string `json:"href"`
				} `json:"self"`
				HTML struct {
					Href string `json:"href"`
				} `json:"html"`
				Avatar struct {
					Href string `json:"href"`
				} `json:"avatar"`
			} `json:"links"`
			UUID string `json:"uuid"`
		} `json:"workspace"`
		Type      string `json:"type"`
		IsPrivate bool   `json:"is_private"`
		Name      string `json:"name"`
	} `json:"repository"`
}

BitbucketWebHookEvent contains github web hook event data

type BitbucketWebhook

type BitbucketWebhook struct {
	ReadOnly    bool   `json:"read_only"`
	Description string `json:"description"`
	Links       struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"links"`
	URL                  string      `json:"url"`
	CreatedAt            time.Time   `json:"created_at"`
	SkipCertVerification bool        `json:"skip_cert_verification"`
	Source               interface{} `json:"source"`
	HistoryEnabled       bool        `json:"history_enabled"`
	Active               bool        `json:"active"`
	Subject              struct {
		Links struct {
			Self struct {
				Href string `json:"href"`
			} `json:"self"`
			HTML struct {
				Href string `json:"href"`
			} `json:"html"`
			Avatar struct {
				Href string `json:"href"`
			} `json:"avatar"`
		} `json:"links"`
		Type     string `json:"type"`
		Name     string `json:"name"`
		FullName string `json:"full_name"`
		UUID     string `json:"uuid"`
	} `json:"subject"`
	Type   string   `json:"type"`
	Events []string `json:"events"`
	UUID   string   `json:"uuid"`
}

BitbucketWebhook contains bitbucket web hook data

func (BitbucketWebhook) GetGitWebhook

func (webhook BitbucketWebhook) GetGitWebhook() GitWebhook

GetGitWebhook converts BitbucketWebhook object to GitWebhook object

type Commit

type Commit struct {
	URL     string `json:"url"`
	Sha     string `json:"sha"`
	NodeID  string `json:"node_id"`
	HTMLURL string `json:"html_url"`
	Commit  struct {
		Message string `json:"message"`
		Author  struct {
			Name  string    `json:"name"`
			Email string    `json:"email"`
			Date  time.Time `json:"date"`
		} `json:"author"`
	} `json:"commit"`
}

type Company

type Company struct {
	MetaData     CompanyMetadata      `bson:"_metadata" json:"_metadata"`
	Id           string               `bson:"id" json:"id"`
	Name         string               `bson:"name" json:"name"`
	Repositories []Repository         `bson:"repositories" json:"repositories"`
	Status       enums.COMPANY_STATUS `bson:"status" json:"status"`
}

Company contains company data

func (Company) GetCompanyWithoutApplications

func (dto Company) GetCompanyWithoutApplications(option CompanyQueryOption) Company

GetCompanyWithoutApplications returns company with repositories

func (Company) GetCompanyWithoutRepository

func (dto Company) GetCompanyWithoutRepository() Company

GetCompanyWithoutRepository returns company without repositories

func (Company) Validate

func (dto Company) Validate() error

Validate validates company data

type CompanyDto

type CompanyDto struct {
	MetaData     CompanyMetadata      `bson:"_metadata" json:"_metadata"`
	Id           string               `bson:"id" json:"id"`
	Name         string               `bson:"name" json:"name"`
	Repositories []RepositoryDto      `bson:"repositories" json:"repositories"`
	Status       enums.COMPANY_STATUS `bson:"status" json:"status"`
}

CompanyDto contains company data

type CompanyMetadata

type CompanyMetadata struct {
	Labels                    map[string]string `bson:"labels" json:"labels" yaml:"labels"`
	NumberOfConcurrentProcess int64             `bson:"number_of_concurrent_process" json:"number_of_concurrent_process" yaml:"number_of_concurrent_process"`
	TotalProcessPerDay        int64             `bson:"total_process_per_day" json:"total_process_per_day" yaml:"total_process_per_day"`
}

CompanyMetadata contains company metadata info

func (CompanyMetadata) Validate

func (metadata CompanyMetadata) Validate() error

Validate validates company metadata

type CompanyQueryOption

type CompanyQueryOption struct {
	Pagination       Pagination
	LoadRepositories bool
	LoadApplications bool
	LoadToken        bool
}

CompanyQueryOption contains company query options

type CompanyWiseRepositoriesDto

type CompanyWiseRepositoriesDto struct {
	MetaData     CompanyMetadata      `bson:"_metadata" json:"_metadata"`
	Id           string               `bson:"id" json:"id"`
	Name         string               `bson:"name" json:"name"`
	Status       enums.COMPANY_STATUS `bson:"status" json:"status"`
	Repositories []struct {
		Id    string                `bson:"_Id" json:"_Id"`
		Type  enums.REPOSITORY_TYPE `bson:"type" json:"type"`
		Token string                `bson:"token" json:"token"`
	} `bson:"repositories" json:"repositories"`
}

CompanyWiseRepositoriesDto contains company wise repositories

type DashboardData

type DashboardData struct {
	Repository struct {
		Count int64 `json:"count"`
	} `json:"repository"`
	Application struct {
		Webhook struct {
			Enabled  int64 `json:"enabled"`
			Disabled int64 `json:"disabled"`
		} `json:"webhook"`
	} `json:"application"`
}

DashboardData contains company resources count info

type DirectoryContentCreateAndUpdateResponse

type DirectoryContentCreateAndUpdateResponse struct {
	Content struct {
		Name        string `json:"name"`
		Path        string `json:"path"`
		Sha         string `json:"sha"`
		Size        int    `json:"size"`
		URL         string `json:"url"`
		HTMLURL     string `json:"html_url"`
		GitURL      string `json:"git_url"`
		DownloadURL string `json:"download_url"`
		Type        string `json:"type"`
		Links       struct {
			Self string `json:"self"`
			Git  string `json:"git"`
			HTML string `json:"html"`
		} `json:"_links"`
	} `json:"content"`
	Commit struct {
		Sha     string `json:"sha"`
		NodeID  string `json:"node_id"`
		URL     string `json:"url"`
		HTMLURL string `json:"html_url"`
		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"`
		Tree struct {
			Sha string `json:"sha"`
			URL string `json:"url"`
		} `json:"tree"`
		Message string `json:"message"`
		Parents []struct {
			Sha     string `json:"sha"`
			URL     string `json:"url"`
			HTMLURL string `json:"html_url"`
		} `json:"parents"`
		Verification struct {
			Verified  bool        `json:"verified"`
			Reason    string      `json:"reason"`
			Signature interface{} `json:"signature"`
			Payload   interface{} `json:"payload"`
		} `json:"verification"`
	} `json:"commit"`
}

DirectoryContentCreateAndUpdateResponse contains directory content create and update response

type DirectoryContentCreatePayload

type DirectoryContentCreatePayload struct {
	Message string `json:"message"`
	Content string `json:"content"`
}

DirectoryContentCreatePayload contains directory content create payload

type DirectoryContentUpdatePayload

type DirectoryContentUpdatePayload struct {
	Message string `json:"message"`
	Content string `json:"content"`
	Sha     string `json:"sha"`
}

DirectoryContentUpdatePayload contains directory content update payload

type GitBranches

type GitBranches []struct {
	Name string `json:"name"`
}

GitBranches contains github branches

type GitCommit

type GitCommit struct {
	URL     string `json:"url"`
	Sha     string `json:"sha"`
	NodeID  string `json:"node_id"`
	HTMLURL string `json:"html_url"`
	Commit  struct {
		Message string `json:"message"`
		Author  struct {
			Name  string    `json:"name"`
			Email string    `json:"email"`
			Date  time.Time `json:"date"`
		} `json:"author"`
	} `json:"commit"`
}

GitCommit contains github commit data

type GitContent

type GitContent struct {
	Name     string `json:"name"`
	Path     string `json:"path"`
	Sha      string `json:"sha"`
	Size     int    `json:"size"`
	Type     string `json:"type"`
	Content  string `json:"content"`
	Encoding string `json:"encoding"`
	Links    struct {
		Self string `json:"self"`
		Git  string `json:"git"`
		HTML string `json:"html"`
	} `json:"_links"`
}

GitContent contains github content

type GitDirectoryContent

type GitDirectoryContent struct {
	Name        string      `json:"name"`
	Path        string      `json:"path"`
	Sha         string      `json:"sha"`
	Size        int         `json:"size"`
	URL         string      `json:"url"`
	HTMLURL     string      `json:"html_url"`
	GitURL      string      `json:"git_url"`
	DownloadURL interface{} `json:"download_url"`
	Type        string      `json:"type"`
	Links       struct {
		Self string `json:"self"`
		Git  string `json:"git"`
		HTML string `json:"html"`
	} `json:"_links"`
}

GitDirectoryContent contains github directory data

type GitWebhook

type GitWebhook struct {
	Type   string   `json:"type"`
	ID     string   `json:"id"`
	Active bool     `json:"active"`
	Events []string `json:"events"`
	Config struct {
		URL         string `json:"url"`
		InsecureSsl string `json:"insecure_ssl"`
		ContentType string `json:"content_type"`
	} `json:"config"`
	UpdatedAt     time.Time `json:"updated_at"`
	CreatedAt     time.Time `json:"created_at"`
	URL           string    `json:"url"`
	TestURL       string    `json:"test_url"`
	PingURL       string    `json:"ping_url"`
	DeliveriesURL string    `json:"deliveries_url"`
}

GitWebhook contains github web hook data

type GithubCreateWebhookRequest

type GithubCreateWebhookRequest struct {
	Config struct {
		URL         string `json:"url"`
		ContentType string `json:"content_type"`
	} `json:"config"`
	Events []enums.GITHUB_EVENT `json:"events"`
}

GithubCreateWebhookRequest contains github web hook creation data

type GithubDirectoryContent

type GithubDirectoryContent struct {
	Name        string      `json:"name"`
	Path        string      `json:"path"`
	Sha         string      `json:"sha"`
	Size        int         `json:"size"`
	URL         string      `json:"url"`
	HTMLURL     string      `json:"html_url"`
	GitURL      string      `json:"git_url"`
	DownloadURL interface{} `json:"download_url"`
	Type        string      `json:"type"`
	Links       struct {
		Self string `json:"self"`
		Git  string `json:"git"`
		HTML string `json:"html"`
	} `json:"_links"`
}

GithubDirectoryContent contains github directory data

func (GithubDirectoryContent) GetGitDirectoryContent

func (directoryContent GithubDirectoryContent) GetGitDirectoryContent() GitDirectoryContent

GetGitDirectoryContent converts GithubDirectoryContent object to GitDirectoryContent object

type GithubWebHookEvent

type GithubWebHookEvent struct {
	Ref        string `json:"ref"`
	Before     string `json:"before"`
	After      string `json:"after"`
	Repository struct {
		ID       int    `json:"id"`
		NodeID   string `json:"node_id"`
		Name     string `json:"name"`
		FullName string `json:"full_name"`
		Private  bool   `json:"private"`
		Owner    struct {
			Name              string `json:"name"`
			Email             string `json:"email"`
			Login             string `json:"login"`
			ID                int    `json:"id"`
			NodeID            string `json:"node_id"`
			AvatarURL         string `json:"avatar_url"`
			GravatarID        string `json:"gravatar_id"`
			URL               string `json:"url"`
			HTMLURL           string `json:"html_url"`
			FollowersURL      string `json:"followers_url"`
			FollowingURL      string `json:"following_url"`
			GistsURL          string `json:"gists_url"`
			StarredURL        string `json:"starred_url"`
			SubscriptionsURL  string `json:"subscriptions_url"`
			OrganizationsURL  string `json:"organizations_url"`
			ReposURL          string `json:"repos_url"`
			EventsURL         string `json:"events_url"`
			ReceivedEventsURL string `json:"received_events_url"`
			Type              string `json:"type"`
			SiteAdmin         bool   `json:"site_admin"`
		} `json:"owner"`
		HTMLURL          string      `json:"html_url"`
		Description      interface{} `json:"description"`
		Fork             bool        `json:"fork"`
		URL              string      `json:"url"`
		ForksURL         string      `json:"forks_url"`
		KeysURL          string      `json:"keys_url"`
		CollaboratorsURL string      `json:"collaborators_url"`
		TeamsURL         string      `json:"teams_url"`
		HooksURL         string      `json:"hooks_url"`
		IssueEventsURL   string      `json:"issue_events_url"`
		EventsURL        string      `json:"events_url"`
		AssigneesURL     string      `json:"assignees_url"`
		BranchesURL      string      `json:"branches_url"`
		TagsURL          string      `json:"tags_url"`
		BlobsURL         string      `json:"blobs_url"`
		GitTagsURL       string      `json:"git_tags_url"`
		GitRefsURL       string      `json:"git_refs_url"`
		TreesURL         string      `json:"trees_url"`
		StatusesURL      string      `json:"statuses_url"`
		LanguagesURL     string      `json:"languages_url"`
		StargazersURL    string      `json:"stargazers_url"`
		ContributorsURL  string      `json:"contributors_url"`
		SubscribersURL   string      `json:"subscribers_url"`
		SubscriptionURL  string      `json:"subscription_url"`
		CommitsURL       string      `json:"commits_url"`
		GitCommitsURL    string      `json:"git_commits_url"`
		CommentsURL      string      `json:"comments_url"`
		IssueCommentURL  string      `json:"issue_comment_url"`
		ContentsURL      string      `json:"contents_url"`
		CompareURL       string      `json:"compare_url"`
		MergesURL        string      `json:"merges_url"`
		ArchiveURL       string      `json:"archive_url"`
		DownloadsURL     string      `json:"downloads_url"`
		IssuesURL        string      `json:"issues_url"`
		PullsURL         string      `json:"pulls_url"`
		MilestonesURL    string      `json:"milestones_url"`
		NotificationsURL string      `json:"notifications_url"`
		LabelsURL        string      `json:"labels_url"`
		ReleasesURL      string      `json:"releases_url"`
		DeploymentsURL   string      `json:"deployments_url"`
		CreatedAt        int         `json:"created_at"`
		UpdatedAt        time.Time   `json:"updated_at"`
		PushedAt         int         `json:"pushed_at"`
		GitURL           string      `json:"git_url"`
		SSHURL           string      `json:"ssh_url"`
		CloneURL         string      `json:"clone_url"`
		SvnURL           string      `json:"svn_url"`
		Homepage         interface{} `json:"homepage"`
		Size             int         `json:"size"`
		StargazersCount  int         `json:"stargazers_count"`
		WatchersCount    int         `json:"watchers_count"`
		Language         string      `json:"language"`
		HasIssues        bool        `json:"has_issues"`
		HasProjects      bool        `json:"has_projects"`
		HasDownloads     bool        `json:"has_downloads"`
		HasWiki          bool        `json:"has_wiki"`
		HasPages         bool        `json:"has_pages"`
		ForksCount       int         `json:"forks_count"`
		MirrorURL        interface{} `json:"mirror_url"`
		Archived         bool        `json:"archived"`
		Disabled         bool        `json:"disabled"`
		OpenIssuesCount  int         `json:"open_issues_count"`
		License          interface{} `json:"license"`
		AllowForking     bool        `json:"allow_forking"`
		Forks            int         `json:"forks"`
		OpenIssues       int         `json:"open_issues"`
		Watchers         int         `json:"watchers"`
		DefaultBranch    string      `json:"default_branch"`
		Stargazers       int         `json:"stargazers"`
		MasterBranch     string      `json:"master_branch"`
	} `json:"repository"`
	Pusher struct {
		Name  string `json:"name"`
		Email string `json:"email"`
	} `json:"pusher"`
	Sender struct {
		Login             string `json:"login"`
		ID                int    `json:"id"`
		NodeID            string `json:"node_id"`
		AvatarURL         string `json:"avatar_url"`
		GravatarID        string `json:"gravatar_id"`
		URL               string `json:"url"`
		HTMLURL           string `json:"html_url"`
		FollowersURL      string `json:"followers_url"`
		FollowingURL      string `json:"following_url"`
		GistsURL          string `json:"gists_url"`
		StarredURL        string `json:"starred_url"`
		SubscriptionsURL  string `json:"subscriptions_url"`
		OrganizationsURL  string `json:"organizations_url"`
		ReposURL          string `json:"repos_url"`
		EventsURL         string `json:"events_url"`
		ReceivedEventsURL string `json:"received_events_url"`
		Type              string `json:"type"`
		SiteAdmin         bool   `json:"site_admin"`
	} `json:"sender"`
	Created bool        `json:"created"`
	Deleted bool        `json:"deleted"`
	Forced  bool        `json:"forced"`
	BaseRef interface{} `json:"base_ref"`
	Compare string      `json:"compare"`
	Commits []struct {
		ID        string    `json:"id"`
		TreeID    string    `json:"tree_id"`
		Distinct  bool      `json:"distinct"`
		Message   string    `json:"message"`
		Timestamp time.Time `json:"timestamp"`
		URL       string    `json:"url"`
		Author    struct {
			Name     string `json:"name"`
			Email    string `json:"email"`
			Username string `json:"username"`
		} `json:"author"`
		Committer struct {
			Name     string `json:"name"`
			Email    string `json:"email"`
			Username string `json:"username"`
		} `json:"committer"`
		Added    []interface{} `json:"added"`
		Removed  []interface{} `json:"removed"`
		Modified []string      `json:"modified"`
	} `json:"commits"`
	HeadCommit struct {
		ID        string    `json:"id"`
		TreeID    string    `json:"tree_id"`
		Distinct  bool      `json:"distinct"`
		Message   string    `json:"message"`
		Timestamp time.Time `json:"timestamp"`
		URL       string    `json:"url"`
		Author    struct {
			Name     string `json:"name"`
			Email    string `json:"email"`
			Username string `json:"username"`
		} `json:"author"`
		Committer struct {
			Name     string `json:"name"`
			Email    string `json:"email"`
			Username string `json:"username"`
		} `json:"committer"`
		Added    []interface{} `json:"added"`
		Removed  []interface{} `json:"removed"`
		Modified []string      `json:"modified"`
	} `json:"head_commit"`
}

GithubWebHookEvent contains github web hook event data

type GithubWebhook

type GithubWebhook struct {
	Type   string   `json:"type"`
	ID     int      `json:"id"`
	Active bool     `json:"active"`
	Events []string `json:"events"`
	Config struct {
		URL         string `json:"url"`
		InsecureSsl string `json:"insecure_ssl"`
		ContentType string `json:"content_type"`
	} `json:"config"`
	UpdatedAt     time.Time `json:"updated_at"`
	CreatedAt     time.Time `json:"created_at"`
	URL           string    `json:"url"`
	TestURL       string    `json:"test_url"`
	PingURL       string    `json:"ping_url"`
	DeliveriesURL string    `json:"deliveries_url"`
}

GithubWebhook contains github web hook data

func (GithubWebhook) GetGitWebhook

func (webhook GithubWebhook) GetGitWebhook() GitWebhook

GetGitWebhook converts GithubWebhook object to GitWebhook object

type Jwt

type Jwt struct {
	PublicKey *rsa.PublicKey
}

Jwt contains jwt keys

type LogEvent

type LogEvent struct {
	ProcessId string    `bson:"process_id"`
	Log       string    `bson:"log"`
	Step      string    `bson:"step"`
	CreatedAt time.Time `bson:"created_at"`
}

LogEvent contains log event data

type OnlyCompanyDto

type OnlyCompanyDto struct {
	MetaData CompanyMetadata      `bson:"_metadata" json:"_metadata"`
	Id       string               `bson:"id" json:"id"`
	Name     string               `bson:"name" json:"name"`
	Status   enums.COMPANY_STATUS `bson:"status" json:"status"`
}

OnlyCompanyDto contains only company info

type OnlyRepository

type OnlyRepository struct {
	Id    string                `bson:"_Id" json:"_Id"`
	Type  enums.REPOSITORY_TYPE `bson:"type" json:"type"`
	Token string                `bson:"token" json:"token"`
}

OnlyRepository contains only repository info

func (OnlyRepository) GetRepositoryWithoutApplication

func (dto OnlyRepository) GetRepositoryWithoutApplication() Repository

GetRepositoryWithoutApplication returns repository without applications

type Pagination

type Pagination struct {
	Page  int64
	Limit int64
}

Pagination contains pagination options

type Pipeline

type Pipeline struct {
	MetaData   PipelineMetadata `json:"_metadata" yaml:"_metadata"`
	ApiVersion string           `json:"api_version" yaml:"api_version"`
	Name       string           `json:"name"  yaml:"name"`
	ProcessId  string           `json:"process_id" yaml:"process_id"`
	Steps      []Step           `json:"steps" yaml:"steps"`
}

Pipeline contains pipeline data

func (Pipeline) GetPipelineForValidationFromPipeline

func (pipeline Pipeline) GetPipelineForValidationFromPipeline() PipelineForValidation

func (Pipeline) GetStepNameMap

func (pipeline Pipeline) GetStepNameMap() map[string]bool

func (Pipeline) Validate

func (pipeline Pipeline) Validate() error

Validate validates pipeline data

type PipelineForValidation

type PipelineForValidation struct {
	Name  string              `json:"name"  yaml:"name"`
	Steps []StepForValidation `json:"steps" yaml:"steps"`
}

Pipeline contains pipeline data for validation

type PipelineMetadata

type PipelineMetadata struct {
	CompanyId       string          `json:"company_id" yaml:"company_id"`
	CompanyMetadata CompanyMetadata `json:"company_metadata" yaml:"company_metadata"`
	CommitId        string          `json:"commit_id" yaml:"commit_id"`
}

PipelineMetadata contains pipeline metadata event options

type Process

type Process struct {
	ProcessId    string                 `bson:"process_id" json:"process_id"`
	CompanyId    string                 `bson:"company_id" json:"company_id"`
	AppId        string                 `bson:"app_id" json:"app_id"`
	RepositoryId string                 `bson:"repository_id" json:"repository_id"`
	CommitId     string                 `bson:"commit_id" json:"commit_id"`
	Data         map[string]interface{} `bson:"data" json:"data"`
	Branch       string                 `bson:"branch" json:"branch"`
}

Process contains process inventory event options

type ProcessEvent

type ProcessEvent struct {
	ProcessId string                 `bson:"process_id"`
	Data      map[string]interface{} `bson:"data"`
}

ProcessEvent contains process web socket event

type RepositoriesDto

type RepositoriesDto struct {
	Repositories []Repository `bson:"repositories" json:"repositories"`
}

RepositoriesDto contains repository list

type Repository

type Repository struct {
	Id           string                `bson:"id" json:"id"`
	Type         enums.REPOSITORY_TYPE `bson:"type" json:"type"`
	Token        string                `bson:"token" json:"token"`
	Applications []Application         `bson:"applications" json:"applications"`
}

Repository contains repository info

func RemoveRepository

func RemoveRepository(s []Repository, i int) []Repository

RemoveRepository removes repository from a list by index

func (Repository) Validate

func (repository Repository) Validate() error

Validate validates repository info

type RepositoryDto

type RepositoryDto struct {
	Id           string                `bson:"id" json:"id"`
	Type         enums.REPOSITORY_TYPE `bson:"type" json:"type"`
	Applications []Application         `bson:"applications" json:"applications"`
}

RepositoryDto contains repository info

type RepositoryUpdateOption

type RepositoryUpdateOption struct {
	Option enums.REPOSITORY_UPDATE_OPTION `json:"option"`
}

RepositoryUpdateOption contains repository update options

type SearchData

type SearchData struct {
	Repositories []Repository                    `json:"repositories" bson:"repositories"`
	Applications []ApplicationMetadataCollection `json:"applications" bson:"applications"`
}

SearchData contains repositories and applications info

type StatusQueryOption

type StatusQueryOption struct {
	Option enums.COMPANY_STATUS `json:"option"`
}

StatusQueryOption contains company update options

type Step

type Step struct {
	Name        string                       `json:"name" yaml:"name"`
	Type        enums.STEP_TYPE              `json:"type" yaml:"type"`
	Trigger     enums.TRIGGER                `json:"trigger" yaml:"trigger"`
	Params      map[enums.PARAMS]string      `json:"params" yaml:"params"`
	Next        []string                     `json:"next" yaml:"next"`
	Descriptors *[]unstructured.Unstructured `json:"descriptors" yaml:"descriptors"`
}

Step contains pipeline step info

func (Step) GetNameWithValidation

func (step Step) GetNameWithValidation() map[string]string

func (Step) GetNextWithValidation

func (step Step) GetNextWithValidation(stepNameMap map[string]bool) []map[string]string

func (Step) GetParamsWithValidation

func (step Step) GetParamsWithValidation() []map[string]string

func (Step) GetStepForValidationFromStep

func (step Step) GetStepForValidationFromStep(stepNameMap map[string]bool) StepForValidation

GetStepForValidationFromStep gets StepForValidation object from Step object

func (Step) GetTriggerWithValidation

func (step Step) GetTriggerWithValidation() map[string]string

func (Step) GetTypeWithValidation

func (step Step) GetTypeWithValidation() map[string]string

func (Step) Validate

func (step Step) Validate() error

Validate validates pipeline step

type StepForValidation

type StepForValidation struct {
	Name    map[string]string   `json:"name" yaml:"name"`
	Type    map[string]string   `json:"type" yaml:"type"`
	Trigger map[string]string   `json:"trigger" yaml:"trigger"`
	Params  []map[string]string `json:"params" yaml:"params"`
	Next    []map[string]string `json:"next" yaml:"next"`
}

StepForValidation contains pipeline step info for validation

type Subject

type Subject struct {
	Step, Log             string
	CoreRequestQueryParam map[string]string
	StepType              enums.STEP_TYPE
	EventData             map[string]interface{}
	ProcessLabel          map[string]string
	Pipeline              Pipeline
	App                   struct {
		CompanyId    string
		AppId        string
		RepositoryId string
		Branch       string
	}
}

Subject observers listen event with an object of this struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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