repository

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitMaterial

type GitMaterial struct {
	Id              int      `sql:"id,pk"`
	AppId           int      `sql:"app_id,notnull"`
	GitProviderId   int      `sql:"git_provider_id,notnull"`
	Active          bool     `sql:"active,notnull"`
	Url             string   `sql:"url,omitempty"`
	Name            string   `sql:"name, omitempty"`
	CheckoutPath    string   `sql:"checkout_path, omitempty"`
	FetchSubmodules bool     `sql:"fetch_submodules,notnull"`
	FilterPattern   []string `sql:"filter_pattern"`
	sql.AuditLog
	App         *app.App
	GitProvider *repository.GitProvider
	// contains filtered or unexported fields
}

TODO: add support for submodule

type MaterialRepository

type MaterialRepository interface {
	MaterialExists(url string) (bool, error)
	SaveMaterial(tx *pg.Tx, material *GitMaterial) error
	UpdateMaterial(tx *pg.Tx, material *GitMaterial) error
	Update(materials []*GitMaterial) error
	FindByAppId(appId int) ([]*GitMaterial, error)
	FindById(Id int) (*GitMaterial, error)
	FindByAppIdAndGitMaterialId(appId, id int) (*GitMaterial, error)
	UpdateMaterialScmId(material *GitMaterial) error
	FindByAppIdAndCheckoutPath(appId int, checkoutPath string) (*GitMaterial, error)
	FindByGitProviderId(gitProviderId int) (materials []*GitMaterial, err error)
	MarkMaterialDeleted(tx *pg.Tx, material *GitMaterial) error
	FindNumberOfAppsWithGitRepo(appIds []int) (int, error)
	FindByAppIds(appIds []int) ([]*GitMaterial, error)
}

type MaterialRepositoryImpl

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

func NewMaterialRepositoryImpl

func NewMaterialRepositoryImpl(dbConnection *pg.DB) *MaterialRepositoryImpl

func (MaterialRepositoryImpl) FindByAppId

func (repo MaterialRepositoryImpl) FindByAppId(appId int) ([]*GitMaterial, error)

func (MaterialRepositoryImpl) FindByAppIdAndCheckoutPath

func (repo MaterialRepositoryImpl) FindByAppIdAndCheckoutPath(appId int, checkoutPath string) (*GitMaterial, error)

func (MaterialRepositoryImpl) FindByAppIdAndGitMaterialId

func (repo MaterialRepositoryImpl) FindByAppIdAndGitMaterialId(appId, id int) (*GitMaterial, error)

func (MaterialRepositoryImpl) FindByAppIds

func (repo MaterialRepositoryImpl) FindByAppIds(appId []int) ([]*GitMaterial, error)

func (MaterialRepositoryImpl) FindByGitProviderId

func (repo MaterialRepositoryImpl) FindByGitProviderId(gitProviderId int) (materials []*GitMaterial, err error)

func (MaterialRepositoryImpl) FindById

func (repo MaterialRepositoryImpl) FindById(Id int) (*GitMaterial, error)

func (MaterialRepositoryImpl) FindNumberOfAppsWithGitRepo

func (repo MaterialRepositoryImpl) FindNumberOfAppsWithGitRepo(appIds []int) (int, error)

func (MaterialRepositoryImpl) MarkMaterialDeleted

func (repo MaterialRepositoryImpl) MarkMaterialDeleted(tx *pg.Tx, material *GitMaterial) error

func (MaterialRepositoryImpl) MaterialExists

func (repo MaterialRepositoryImpl) MaterialExists(url string) (bool, error)

func (MaterialRepositoryImpl) SaveMaterial

func (repo MaterialRepositoryImpl) SaveMaterial(tx *pg.Tx, material *GitMaterial) error

func (MaterialRepositoryImpl) Update

func (impl MaterialRepositoryImpl) Update(materials []*GitMaterial) error

func (MaterialRepositoryImpl) UpdateMaterial

func (repo MaterialRepositoryImpl) UpdateMaterial(tx *pg.Tx, material *GitMaterial) error

func (MaterialRepositoryImpl) UpdateMaterialScmId

func (repo MaterialRepositoryImpl) UpdateMaterialScmId(material *GitMaterial) error

Jump to

Keyboard shortcuts

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