Documentation ¶
Index ¶
- type PipeLogService
- func (ps *PipeLogService) Create(log *nocd.PipeLog) error
- func (ps *PipeLogService) GetByID(lid uint) (nocd.PipeLog, error)
- func (ps *PipeLogService) GetByUID(uid, lid uint) (nocd.PipeLog, error)
- func (ps *PipeLogService) LastLogs(num uint) []nocd.PipeLog
- func (ps *PipeLogService) LastPipelineLog(pid uint) nocd.PipeLog
- func (ps *PipeLogService) LastServerLog(sid uint) nocd.PipeLog
- func (ps *PipeLogService) Logs(status int, page, size int64) ([]nocd.PipeLog, int64)
- func (ps *PipeLogService) Pipeline(log *nocd.PipeLog) error
- func (ps *PipeLogService) Update(log *nocd.PipeLog) error
- func (ps *PipeLogService) UserLogs(uid uint, page, size int64) ([]nocd.PipeLog, int64)
- type PipelineService
- func (ps *PipelineService) Create(p *nocd.Pipeline) error
- func (ps *PipelineService) Delete(pid uint) error
- func (ps *PipelineService) GetPipelinesByRidAndEventAndBranch(rid uint, event string, branch string) (p []nocd.Pipeline, err error)
- func (ps *PipelineService) RepoPipelines(r *nocd.Repository) []nocd.Pipeline
- func (ps *PipelineService) Server(p *nocd.Pipeline) error
- func (ps *PipelineService) Update(p *nocd.Pipeline) error
- func (ps *PipelineService) User(p *nocd.Pipeline) error
- func (ps *PipelineService) UserPipeline(uid, pid uint) (nocd.Pipeline, error)
- func (ps *PipelineService) UserPipelines(u *nocd.User) []nocd.Pipeline
- type RepositoryService
- func (rs *RepositoryService) Create(r *nocd.Repository) error
- func (rs *RepositoryService) Delete(rid uint) error
- func (rs *RepositoryService) GetRepoByID(id uint) (r nocd.Repository, err error)
- func (rs *RepositoryService) GetRepoByUser(user *nocd.User) (r []nocd.Repository)
- func (rs *RepositoryService) GetRepoByUserAndID(user *nocd.User, rid uint) (r nocd.Repository, err error)
- func (rs *RepositoryService) Update(r *nocd.Repository) error
- type ServerService
- func (ss *ServerService) CreateServer(s *nocd.Server) error
- func (ss *ServerService) DeleteServer(sid uint) error
- func (ss *ServerService) GetServersByUser(user *nocd.User) (us []nocd.Server)
- func (ss *ServerService) GetServersByUserAndSid(user *nocd.User, sid uint) (s nocd.Server, err error)
- func (ss *ServerService) UpdateServer(s *nocd.Server) error
- type UserService
- func (us *UserService) Create(u *nocd.User) error
- func (us *UserService) Update(u *nocd.User) error
- func (us *UserService) UserByGID(gid int64) (*nocd.User, error)
- func (us *UserService) Users(page, size int64) ([]*nocd.User, int64)
- func (us *UserService) Verify(uid, token string) (*nocd.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PipeLogService ¶
PipeLogService 日志服务
func (*PipeLogService) Create ¶
func (ps *PipeLogService) Create(log *nocd.PipeLog) error
Create 创建日志
func (*PipeLogService) GetByID ¶
func (ps *PipeLogService) GetByID(lid uint) (nocd.PipeLog, error)
GetByID 通过日志ID获取日志
func (*PipeLogService) GetByUID ¶
func (ps *PipeLogService) GetByUID(uid, lid uint) (nocd.PipeLog, error)
GetByUID 通过用户ID和部署流程ID查找日志
func (*PipeLogService) LastLogs ¶
func (ps *PipeLogService) LastLogs(num uint) []nocd.PipeLog
LastLogs 全站最后部署记录
func (*PipeLogService) LastPipelineLog ¶
func (ps *PipeLogService) LastPipelineLog(pid uint) nocd.PipeLog
LastPipelineLog 部署流程最后一次部署
func (*PipeLogService) LastServerLog ¶
func (ps *PipeLogService) LastServerLog(sid uint) nocd.PipeLog
LastServerLog 服务器的最后一次部署
func (*PipeLogService) Pipeline ¶
func (ps *PipeLogService) Pipeline(log *nocd.PipeLog) error
Pipeline 获取部署流程信息
type PipelineService ¶
PipelineService Sqlite3的用户服务实现
func (*PipelineService) Create ¶
func (ps *PipelineService) Create(p *nocd.Pipeline) error
Create 创建用户
func (*PipelineService) GetPipelinesByRidAndEventAndBranch ¶
func (ps *PipelineService) GetPipelinesByRidAndEventAndBranch(rid uint, event string, branch string) (p []nocd.Pipeline, err error)
GetPipelinesByRidAndEventAndBranch 根据流ID和事件及分支获取部署流
func (*PipelineService) RepoPipelines ¶
func (ps *PipelineService) RepoPipelines(r *nocd.Repository) []nocd.Pipeline
RepoPipelines 获取项目下面的所有部署流
func (*PipelineService) Server ¶
func (ps *PipelineService) Server(p *nocd.Pipeline) error
Server 读取所属服务器信息
func (*PipelineService) Update ¶
func (ps *PipelineService) Update(p *nocd.Pipeline) error
Update 更新用户
func (*PipelineService) User ¶
func (ps *PipelineService) User(p *nocd.Pipeline) error
User 读取所属用户信息
func (*PipelineService) UserPipeline ¶
func (ps *PipelineService) UserPipeline(uid, pid uint) (nocd.Pipeline, error)
UserPipeline 根据用户ID和部署流ID获取部署流,通常用来检测用户对部署流的操作权限
func (*PipelineService) UserPipelines ¶
func (ps *PipelineService) UserPipelines(u *nocd.User) []nocd.Pipeline
UserPipelines 获取用户的所有部署流
type RepositoryService ¶
RepositoryService 项目服务
func (*RepositoryService) Create ¶
func (rs *RepositoryService) Create(r *nocd.Repository) error
Create 创建项目
func (*RepositoryService) GetRepoByID ¶
func (rs *RepositoryService) GetRepoByID(id uint) (r nocd.Repository, err error)
GetRepoByID 通过ID获取项目
func (*RepositoryService) GetRepoByUser ¶
func (rs *RepositoryService) GetRepoByUser(user *nocd.User) (r []nocd.Repository)
GetRepoByUser 获取用户的所有项目
func (*RepositoryService) GetRepoByUserAndID ¶
func (rs *RepositoryService) GetRepoByUserAndID(user *nocd.User, rid uint) (r nocd.Repository, err error)
GetRepoByUserAndID 通过用户ID和项目ID寻找
func (*RepositoryService) Update ¶
func (rs *RepositoryService) Update(r *nocd.Repository) error
Update 更新项目
type ServerService ¶
ServerService 服务器服务
func (*ServerService) CreateServer ¶
func (ss *ServerService) CreateServer(s *nocd.Server) error
CreateServer 创建服务器
func (*ServerService) DeleteServer ¶
func (ss *ServerService) DeleteServer(sid uint) error
DeleteServer 删除服务器
func (*ServerService) GetServersByUser ¶
func (ss *ServerService) GetServersByUser(user *nocd.User) (us []nocd.Server)
GetServersByUser 获取用户的所有服务器
func (*ServerService) GetServersByUserAndSid ¶
func (ss *ServerService) GetServersByUserAndSid(user *nocd.User, sid uint) (s nocd.Server, err error)
GetServersByUserAndSid 根据用户ID和服务器ID获取服务器
func (*ServerService) UpdateServer ¶
func (ss *ServerService) UpdateServer(s *nocd.Server) error
UpdateServer 更细服务器