dao

package
v0.0.0-...-8010d25 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IIdlDaoManager

type IIdlDaoManager interface {
	AddIDL(ctx context.Context, idlModel model.IDL) (int64, error)

	DeleteIDLs(ctx context.Context, ids []int64) error

	UpdateIDL(ctx context.Context, idlModel model.IDL) error
	Sync(ctx context.Context, idlModel model.IDL) error

	GetIDL(ctx context.Context, id int64) (*model.IDLWithRepositoryInfo, error)
	GetIDLList(ctx context.Context, idlModel model.IDL, page, limit, order int32, orderBy string) ([]*model.IDLWithRepositoryInfo, int64, error)
	CheckMainIdlIfExist(ctx context.Context, repositoryId int64, mainIdlPath string) (bool, error)
}

type IRepositoryDaoManager

type IRepositoryDaoManager interface {
	AddRepository(ctx context.Context, repoModel model.Repository) (int64, error)

	DeleteRepository(ctx context.Context, ids []int64) error

	UpdateRepository(ctx context.Context, repoModel model.Repository) error
	Sync(ctx context.Context, repoModel model.Repository) error
	ChangeRepositoryStatus(ctx context.Context, id int64, status int32) error

	GetRepository(ctx context.Context, id int64) (*model.Repository, error)
	GetRepositoryList(ctx context.Context, repositoryModel model.Repository, page, limit, order int32, orderBy string) ([]*model.Repository, int64, error)
	GetAllRepositories(ctx context.Context) ([]*model.Repository, error)
	GetTokenByID(ctx context.Context, id int64) (string, error)
	GetRepoTypeByID(ctx context.Context, id int64) (int32, error)
	IsExist(ctx context.Context, domain, owner, repoName string) (bool, error)
}

type ITemplateDaoManager

type ITemplateDaoManager interface {
	AddTemplate(ctx context.Context, templateModel model.Template) error

	DeleteTemplate(ctx context.Context, ids []int64) error

	UpdateTemplate(ctx context.Context, templateModel model.Template) error

	GetTemplateList(ctx context.Context, page, limit, order int32, orderBy string) ([]*model.Template, error)

	AddTemplateItem(ctx context.Context, templateItemModel model.TemplateItem) error

	DeleteTemplateItem(ctx context.Context, ids []int64) error

	UpdateTemplateItem(ctx context.Context, templateItemModel model.TemplateItem) error

	GetTemplateItemList(ctx context.Context, templateId int64, page, limit, order int32, orderBy string) ([]*model.TemplateItem, error)
}

type ITokenDaoManager

type ITokenDaoManager interface {
	AddToken(ctx context.Context, tokenModel model.Token) (int64, error)

	DeleteToken(ctx context.Context, ids []int64) error

	GetTokenList(ctx context.Context, tokenModel model.Token, page, limit, order int32, orderBy string) ([]*model.Token, int64, error)
	GetActiveTokenForDomain(ctx context.Context, domain string) ([]*model.Token, error)
	GetTokenById(ctx context.Context, id int64) (*model.Token, error)
}

type Manager

type Manager struct {
	Idl        IIdlDaoManager
	Repository IRepositoryDaoManager
	Template   ITemplateDaoManager
	Token      ITokenDaoManager
}

func NewDaoManager

func NewDaoManager(conf config.StoreConfig) (*Manager, error)

type MysqlIDLManager

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

func NewMysqlIDL

func NewMysqlIDL(db *gorm.DB) *MysqlIDLManager

func (*MysqlIDLManager) AddIDL

func (m *MysqlIDLManager) AddIDL(ctx context.Context, idlModel model.IDL) (int64, error)

func (*MysqlIDLManager) CheckMainIdlIfExist

func (m *MysqlIDLManager) CheckMainIdlIfExist(ctx context.Context, repositoryId int64, mainIdlPath string) (bool, error)

func (*MysqlIDLManager) DeleteIDLs

func (m *MysqlIDLManager) DeleteIDLs(ctx context.Context, ids []int64) error

func (*MysqlIDLManager) GetIDL

func (*MysqlIDLManager) GetIDLList

func (m *MysqlIDLManager) GetIDLList(ctx context.Context, idlModel model.IDL, page, limit, order int32, orderBy string) ([]*model.IDLWithRepositoryInfo, int64, error)

func (*MysqlIDLManager) Sync

func (m *MysqlIDLManager) Sync(ctx context.Context, idlModel model.IDL) error

func (*MysqlIDLManager) UpdateIDL

func (m *MysqlIDLManager) UpdateIDL(ctx context.Context, idlModel model.IDL) error

type MysqlRepositoryManager

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

func NewMysqlRepository

func NewMysqlRepository(db *gorm.DB) *MysqlRepositoryManager

func (*MysqlRepositoryManager) AddRepository

func (m *MysqlRepositoryManager) AddRepository(ctx context.Context, repoModel model.Repository) (int64, error)

func (*MysqlRepositoryManager) ChangeRepositoryStatus

func (m *MysqlRepositoryManager) ChangeRepositoryStatus(ctx context.Context, id int64, status int32) error

func (*MysqlRepositoryManager) DeleteRepository

func (m *MysqlRepositoryManager) DeleteRepository(ctx context.Context, ids []int64) error

func (*MysqlRepositoryManager) GetAllRepositories

func (m *MysqlRepositoryManager) GetAllRepositories(ctx context.Context) ([]*model.Repository, error)

func (*MysqlRepositoryManager) GetRepoTypeByID

func (m *MysqlRepositoryManager) GetRepoTypeByID(ctx context.Context, id int64) (int32, error)

func (*MysqlRepositoryManager) GetRepository

func (m *MysqlRepositoryManager) GetRepository(ctx context.Context, id int64) (*model.Repository, error)

func (*MysqlRepositoryManager) GetRepositoryList

func (m *MysqlRepositoryManager) GetRepositoryList(ctx context.Context, repositoryModel model.Repository, page, limit, order int32, orderBy string) ([]*model.Repository, int64, error)

func (*MysqlRepositoryManager) GetTokenByID

func (m *MysqlRepositoryManager) GetTokenByID(ctx context.Context, id int64) (string, error)

func (*MysqlRepositoryManager) IsExist

func (m *MysqlRepositoryManager) IsExist(ctx context.Context, domain, owner, repoName string) (bool, error)

func (*MysqlRepositoryManager) Sync

func (m *MysqlRepositoryManager) Sync(ctx context.Context, repoModel model.Repository) error

func (*MysqlRepositoryManager) UpdateRepository

func (m *MysqlRepositoryManager) UpdateRepository(ctx context.Context, repoModel model.Repository) error

type MysqlTemplateManager

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

func NewMysqlTemplate

func NewMysqlTemplate(db *gorm.DB) *MysqlTemplateManager

func (*MysqlTemplateManager) AddTemplate

func (m *MysqlTemplateManager) AddTemplate(ctx context.Context, templateModel model.Template) error

func (*MysqlTemplateManager) AddTemplateItem

func (m *MysqlTemplateManager) AddTemplateItem(ctx context.Context, templateItemModel model.TemplateItem) error

func (*MysqlTemplateManager) DeleteTemplate

func (m *MysqlTemplateManager) DeleteTemplate(ctx context.Context, ids []int64) error

func (*MysqlTemplateManager) DeleteTemplateItem

func (m *MysqlTemplateManager) DeleteTemplateItem(ctx context.Context, ids []int64) error

func (*MysqlTemplateManager) GetTemplateItemList

func (m *MysqlTemplateManager) GetTemplateItemList(ctx context.Context, templateId int64, page, limit, order int32, orderBy string) ([]*model.TemplateItem, error)

func (*MysqlTemplateManager) GetTemplateList

func (m *MysqlTemplateManager) GetTemplateList(ctx context.Context, page, limit, order int32, orderBy string) ([]*model.Template, error)

func (*MysqlTemplateManager) UpdateTemplate

func (m *MysqlTemplateManager) UpdateTemplate(ctx context.Context, templateModel model.Template) error

func (*MysqlTemplateManager) UpdateTemplateItem

func (m *MysqlTemplateManager) UpdateTemplateItem(ctx context.Context, templateItemModel model.TemplateItem) error

type MysqlTokenManager

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

func NewMysqlToken

func NewMysqlToken(db *gorm.DB) *MysqlTokenManager

func (*MysqlTokenManager) AddToken

func (m *MysqlTokenManager) AddToken(ctx context.Context, tokenModel model.Token) (int64, error)

func (*MysqlTokenManager) DeleteToken

func (m *MysqlTokenManager) DeleteToken(ctx context.Context, ids []int64) error

func (*MysqlTokenManager) GetActiveTokenForDomain

func (m *MysqlTokenManager) GetActiveTokenForDomain(ctx context.Context, domain string) ([]*model.Token, error)

func (*MysqlTokenManager) GetTokenById

func (m *MysqlTokenManager) GetTokenById(ctx context.Context, id int64) (*model.Token, error)

func (*MysqlTokenManager) GetTokenList

func (m *MysqlTokenManager) GetTokenList(ctx context.Context, tokenModel model.Token, page, limit, order int32, orderBy string) ([]*model.Token, int64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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