Documentation ¶
Index ¶
- Constants
- type PublishSvc
- func (p *PublishSvc) DecryptPublishContent(ctx context.Context, pContent string) string
- func (p *PublishSvc) DeletePublish(ctx context.Context, projectID, namespaceID int, newStatus int) error
- func (p *PublishSvc) EnterPublish(ctx context.Context, projectID, namespaceID, configID int, content string) error
- func (p *PublishSvc) IsInPublish(ctx context.Context, projectKey, namespaceName string) (bool, error)
- func (p *PublishSvc) ListPublishConfig(ctx context.Context, projectID, namespaceID int) ([]model.PublishConfig, string, error)
Constants ¶
View Source
const PUBLISH = "PUBLISH"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PublishSvc ¶
type PublishSvc struct { DB db.Repo Store storage.Repo PublishRepo repo.PublishRepo PublishConfigRepo repo.PublishConfigRepo // contains filtered or unexported fields }
func NewPublishSvc ¶
func NewPublishSvc( db db.Repo, store storage.Repo, cs svc_interface.ConfigSystem, pur repo.PublishRepo, puc repo.PublishConfigRepo, ) *PublishSvc
func (*PublishSvc) DecryptPublishContent ¶
func (p *PublishSvc) DecryptPublishContent(ctx context.Context, pContent string) string
func (*PublishSvc) DeletePublish ¶
func (p *PublishSvc) DeletePublish(ctx context.Context, projectID, namespaceID int, newStatus int) error
DeletePublish 将 PublishToken 从 ETCD 中删除 并且设置 Publish 为 newStatus。
func (*PublishSvc) EnterPublish ¶
func (p *PublishSvc) EnterPublish(ctx context.Context, projectID, namespaceID, configID int, content string) error
EnterPublish 并发安全 进入发布,如果namespace尚未处于发布期,则自动进入发布期 将 config 加入 namespace 的发布期 如果 config 已加入,则更新 config 内容 如果 config 未加入,则加入 如果 config 已被锁定,则返回无法进入
func (*PublishSvc) IsInPublish ¶
func (*PublishSvc) ListPublishConfig ¶
func (p *PublishSvc) ListPublishConfig(ctx context.Context, projectID, namespaceID int) ([]model.PublishConfig, string, error)
ListPublishConfig 获取命名空间下所有的处于发布期的配置 如果命名空间没有处于发布期,则返回错误 如果命名空间处于发布期,则返回旗下待发布的配置列表
Click to show internal directories.
Click to hide internal directories.