Help us shape the future of Go! Take the 2026 Go Developer Survey

repos

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyRepo = "gitploy.repo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {

	// APIs used for talking to different parts of the entities.
	Repo             *RepoAPI
	Commits          *CommitAPI
	Branch           *BranchAPI
	Tag              *TagAPI
	Deployment       *DeploymentAPI
	Config           *ConfigAPI
	Review           *ReviewAPI
	DeploymentStatus *DeploymentStatusAPI
	Lock             *LockAPI
	Perm             *PermAPI
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(c APIConfig) *API

type APIConfig

type APIConfig struct {
	Interactor
}

type BranchAPI

type BranchAPI service

func (*BranchAPI) Get

func (s *BranchAPI) Get(c *gin.Context)

func (*BranchAPI) GetDefault

func (s *BranchAPI) GetDefault(c *gin.Context)

func (*BranchAPI) List

func (s *BranchAPI) List(c *gin.Context)

type CommitAPI

type CommitAPI service

func (*CommitAPI) Get

func (s *CommitAPI) Get(c *gin.Context)

func (*CommitAPI) List

func (s *CommitAPI) List(c *gin.Context)

func (*CommitAPI) ListStatuses

func (s *CommitAPI) ListStatuses(c *gin.Context)

type ConfigAPI

type ConfigAPI service

func (*ConfigAPI) Get

func (s *ConfigAPI) Get(c *gin.Context)

type DeploymentAPI

type DeploymentAPI service

func (*DeploymentAPI) Create

func (s *DeploymentAPI) Create(c *gin.Context)

func (*DeploymentAPI) Get

func (s *DeploymentAPI) Get(c *gin.Context)

func (*DeploymentAPI) List

func (s *DeploymentAPI) List(c *gin.Context)

func (*DeploymentAPI) ListChanges

func (s *DeploymentAPI) ListChanges(c *gin.Context)

func (*DeploymentAPI) Rollback

func (s *DeploymentAPI) Rollback(c *gin.Context)

func (*DeploymentAPI) Update

func (s *DeploymentAPI) Update(c *gin.Context)

UpdateDeployment trigger to request for a waiting deployment, and it patches the deployment status 'created'.

type DeploymentPostPayload

type DeploymentPostPayload struct {
	Type           string                 `json:"type"`
	Ref            string                 `json:"ref"`
	Env            string                 `json:"env"`
	DynamicPayload map[string]interface{} `json:"dynamic_payload"`
}

type DeploymentStatusAPI

type DeploymentStatusAPI service

func (*DeploymentStatusAPI) CreateRemote

func (s *DeploymentStatusAPI) CreateRemote(c *gin.Context)

func (*DeploymentStatusAPI) List

func (s *DeploymentStatusAPI) List(c *gin.Context)

type DeploymentStatusPostPayload

type DeploymentStatusPostPayload struct {
	Status      string `json:"status"`
	Description string `json:"description"`
	LogURL      string `json:"log_url"`
}

type Interactor

type Interactor interface {
	FindUserByID(ctx context.Context, id int64) (*ent.User, error)

	ListPermsOfRepo(ctx context.Context, r *ent.Repo, opt *i.ListPermsOfRepoOptions) ([]*ent.Perm, error)
	FindPermOfRepo(ctx context.Context, r *ent.Repo, u *ent.User) (*ent.Perm, error)

	ListReposOfUser(ctx context.Context, u *ent.User, opt *i.ListReposOfUserOptions) ([]*ent.Repo, error)
	FindRepoOfUserByID(ctx context.Context, u *ent.User, id int64) (*ent.Repo, error)
	FindRepoOfUserByNamespaceName(ctx context.Context, u *ent.User, opt *i.FindRepoOfUserByNamespaceNameOptions) (*ent.Repo, error)
	UpdateRepo(ctx context.Context, r *ent.Repo) (*ent.Repo, error)
	ActivateRepo(ctx context.Context, u *ent.User, r *ent.Repo) (*ent.Repo, error)
	DeactivateRepo(ctx context.Context, u *ent.User, r *ent.Repo) (*ent.Repo, error)

	ListDeploymentsOfRepo(ctx context.Context, r *ent.Repo, opt *i.ListDeploymentsOfRepoOptions) ([]*ent.Deployment, error)
	FindDeploymentByID(ctx context.Context, id int) (*ent.Deployment, error)
	FindDeploymentOfRepoByNumber(ctx context.Context, r *ent.Repo, number int) (*ent.Deployment, error)
	FindPrevSuccessDeployment(ctx context.Context, d *ent.Deployment) (*ent.Deployment, error)
	Deploy(ctx context.Context, u *ent.User, re *ent.Repo, d *ent.Deployment, env *extent.Env) (*ent.Deployment, error)
	DeployToRemote(ctx context.Context, u *ent.User, r *ent.Repo, d *ent.Deployment, env *extent.Env) (*ent.Deployment, error)
	GetConfig(ctx context.Context, u *ent.User, r *ent.Repo) (*extent.Config, error)
	GetEvaluatedConfig(ctx context.Context, u *ent.User, r *ent.Repo, v *extent.EvalValues) (*extent.Config, error)

	ListDeploymentStatuses(ctx context.Context, d *ent.Deployment) ([]*ent.DeploymentStatus, error)
	CreateRemoteDeploymentStatus(ctx context.Context, u *ent.User, r *ent.Repo, d *ent.Deployment, ds *extent.RemoteDeploymentStatus) (*extent.RemoteDeploymentStatus, error)

	ListReviews(ctx context.Context, d *ent.Deployment) ([]*ent.Review, error)
	FindReviewOfUser(ctx context.Context, u *ent.User, d *ent.Deployment) (*ent.Review, error)
	UpdateReview(ctx context.Context, rv *ent.Review) (*ent.Review, error)
	RespondReview(ctx context.Context, rv *ent.Review) (*ent.Review, error)

	ListLocksOfRepo(ctx context.Context, r *ent.Repo) ([]*ent.Lock, error)
	HasLockOfRepoForEnv(ctx context.Context, r *ent.Repo, env string) (bool, error)
	FindLockByID(ctx context.Context, id int) (*ent.Lock, error)
	CreateLock(ctx context.Context, l *ent.Lock) (*ent.Lock, error)
	UpdateLock(ctx context.Context, l *ent.Lock) (*ent.Lock, error)
	DeleteLock(ctx context.Context, l *ent.Lock) error

	ListCommits(ctx context.Context, u *ent.User, r *ent.Repo, branch string, opt *i.ListOptions) ([]*extent.Commit, error)
	CompareCommits(ctx context.Context, u *ent.User, r *ent.Repo, base, head string, opt *i.ListOptions) ([]*extent.Commit, []*extent.CommitFile, error)
	GetCommit(ctx context.Context, u *ent.User, r *ent.Repo, sha string) (*extent.Commit, error)
	ListCommitStatuses(ctx context.Context, u *ent.User, r *ent.Repo, sha string) ([]*extent.Status, error)

	ListBranches(ctx context.Context, u *ent.User, r *ent.Repo, opt *i.ListOptions) ([]*extent.Branch, error)
	GetBranch(ctx context.Context, u *ent.User, r *ent.Repo, branch string) (*extent.Branch, error)
	GetDefaultBranch(ctx context.Context, u *ent.User, r *ent.Repo) (*extent.Branch, error)

	ListTags(ctx context.Context, u *ent.User, r *ent.Repo, opt *i.ListOptions) ([]*extent.Tag, error)
	GetTag(ctx context.Context, u *ent.User, r *ent.Repo, tag string) (*extent.Tag, error)
}

type LockAPI

type LockAPI service

func (*LockAPI) Create

func (s *LockAPI) Create(c *gin.Context)

func (*LockAPI) Delete

func (s *LockAPI) Delete(c *gin.Context)

func (*LockAPI) List

func (s *LockAPI) List(c *gin.Context)

func (*LockAPI) Update

func (s *LockAPI) Update(c *gin.Context)

type LockPatchPayload

type LockPatchPayload struct {
	ExpiredAt *string `json:"expired_at,omitempty"`
}

type LockPostPayload

type LockPostPayload struct {
	Env       string  `json:"env"`
	ExpiredAt *string `json:"expired_at,omitempty"`
}

type PermAPI

type PermAPI service

func (*PermAPI) List

func (s *PermAPI) List(c *gin.Context)

type RepoAPI

type RepoAPI service

func (*RepoAPI) Get

func (s *RepoAPI) Get(c *gin.Context)

func (*RepoAPI) List

func (s *RepoAPI) List(c *gin.Context)

func (*RepoAPI) Update

func (s *RepoAPI) Update(c *gin.Context)

type RepoMiddleware

type RepoMiddleware struct {
	// contains filtered or unexported fields
}

func NewRepoMiddleware

func NewRepoMiddleware(i Interactor) *RepoMiddleware

func (*RepoMiddleware) RepoAdminPerm

func (rm *RepoMiddleware) RepoAdminPerm() gin.HandlerFunc

func (*RepoMiddleware) RepoReadPerm

func (rm *RepoMiddleware) RepoReadPerm() gin.HandlerFunc

func (*RepoMiddleware) RepoWritePerm

func (rm *RepoMiddleware) RepoWritePerm() gin.HandlerFunc

type RepoPatchPayload

type RepoPatchPayload struct {
	Name       *string `json:"name"`
	ConfigPath *string `json:"config_path"`
	Active     *bool   `json:"active"`
}

type ReviewAPI

type ReviewAPI service

func (*ReviewAPI) GetMine

func (s *ReviewAPI) GetMine(c *gin.Context)

func (*ReviewAPI) List

func (s *ReviewAPI) List(c *gin.Context)

func (*ReviewAPI) UpdateMine

func (s *ReviewAPI) UpdateMine(c *gin.Context)

type ReviewPatchPayload

type ReviewPatchPayload struct {
	Status  string  `json:"status"`
	Comment *string `json:"comment"`
}

type TagAPI

type TagAPI service

func (*TagAPI) Get

func (s *TagAPI) Get(c *gin.Context)

func (*TagAPI) List

func (s *TagAPI) List(c *gin.Context)

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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