Documentation ¶
Index ¶
- Constants
- Variables
- func IsVersion(obj interface{}) (IsVersion bool)
- func SetPrimaryKeysConditionWithoutVersion(db *gorm.DB, record interface{}, s *schema.Schema) *gorm.DB
- func UploadOrDelete(objs []*PublishAction, storage oss.StorageInterface) (err error)
- type AfterPublishInterface
- type AfterUnPublishInterface
- type Builder
- func (b *Builder) Context() context.Context
- func (b *Builder) Publish(record interface{}) (err error)
- func (b *Builder) Sync(models ...interface{}) error
- func (b *Builder) UnPublish(record interface{}) (err error)
- func (b *Builder) WithEventContext(val interface{}) *Builder
- func (b *Builder) WithL10nBuilder(val interface{}) *Builder
- func (b *Builder) WithPageBuilder(val interface{}) *Builder
- func (b *Builder) WithValue(key, val interface{}) *Builder
- type List
- func (this List) GetListDeleted() bool
- func (this List) GetListUpdated() bool
- func (this List) GetPageNumber() int
- func (this List) GetPosition() int
- func (this *List) SetListDeleted(listDeleted bool)
- func (this *List) SetListUpdated(listUpdated bool)
- func (this *List) SetPageNumber(pageNumber int)
- func (this *List) SetPosition(position int)
- type ListInterface
- type ListPublishBuilder
- func (b *ListPublishBuilder) GetOldItemsFunc(f func(record interface{}) (result []interface{}, err error)) *ListPublishBuilder
- func (b *ListPublishBuilder) NeedNextPageFunc(f func(totalNumberPerPage, currentPageNumber, totalNumberOfItems int) bool) *ListPublishBuilder
- func (b *ListPublishBuilder) PublishActionsFunc(...) *ListPublishBuilder
- func (b *ListPublishBuilder) Run(model interface{}) (err error)
- func (b *ListPublishBuilder) TotalNumberPerPage(number int) *ListPublishBuilder
- func (b *ListPublishBuilder) WithValue(key, val interface{}) *ListPublishBuilder
- type ListPublisher
- type OnePageItems
- type PublishAction
- type PublishInterface
- type Schedule
- func (schedule Schedule) GetPublishedAt() *time.Time
- func (schedule Schedule) GetScheduledEndAt() *time.Time
- func (schedule Schedule) GetScheduledStartAt() *time.Time
- func (schedule Schedule) GetUnPublishedAt() *time.Time
- func (schedule *Schedule) SetPublishedAt(v *time.Time)
- func (schedule *Schedule) SetScheduledEndAt(v *time.Time)
- func (schedule *Schedule) SetScheduledStartAt(v *time.Time)
- func (schedule *Schedule) SetUnPublishedAt(v *time.Time)
- type ScheduleInterface
- type SchedulePublishBuilder
- type SchedulePublisher
- type Status
- type StatusInterface
- type UnPublishInterface
- type Version
- type VersionInterface
Constants ¶
View Source
const ( PublishContextKeyPageBuilder = "pagebuilder" PublishContextKeyL10nBuilder = "l10nbuilder" PublishContextKeyEventContext = "eventcontext" )
View Source
const ( StatusDraft = "draft" StatusOnline = "online" StatusOffline = "offline" )
Variables ¶
View Source
var ListPublishModels map[string]interface{}
View Source
var NonVersionPublishModels map[string]interface{}
View Source
var VersionPublishModels map[string]interface{}
Functions ¶
func UploadOrDelete ¶
func UploadOrDelete(objs []*PublishAction, storage oss.StorageInterface) (err error)
Types ¶
type AfterPublishInterface ¶
type AfterUnPublishInterface ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) WithEventContext ¶
func (*Builder) WithL10nBuilder ¶
func (*Builder) WithPageBuilder ¶
type List ¶
func (List) GetListDeleted ¶
func (List) GetListUpdated ¶
func (List) GetPageNumber ¶
func (List) GetPosition ¶
func (*List) SetListDeleted ¶
func (*List) SetListUpdated ¶
func (*List) SetPageNumber ¶
func (*List) SetPosition ¶
type ListInterface ¶
type ListPublishBuilder ¶
type ListPublishBuilder struct {
// contains filtered or unexported fields
}
func NewListPublishBuilder ¶
func NewListPublishBuilder(db *gorm.DB, storage oss.StorageInterface) *ListPublishBuilder
func (*ListPublishBuilder) GetOldItemsFunc ¶
func (b *ListPublishBuilder) GetOldItemsFunc(f func(record interface{}) (result []interface{}, err error)) *ListPublishBuilder
func (*ListPublishBuilder) NeedNextPageFunc ¶
func (b *ListPublishBuilder) NeedNextPageFunc(f func(totalNumberPerPage, currentPageNumber, totalNumberOfItems int) bool) *ListPublishBuilder
func (*ListPublishBuilder) PublishActionsFunc ¶
func (b *ListPublishBuilder) PublishActionsFunc(f func(db *gorm.DB, lp ListPublisher, result []*OnePageItems, indexPage *OnePageItems) (objs []*PublishAction)) *ListPublishBuilder
func (*ListPublishBuilder) Run ¶
func (b *ListPublishBuilder) Run(model interface{}) (err error)
model is a empty struct example: Product{}
func (*ListPublishBuilder) TotalNumberPerPage ¶
func (b *ListPublishBuilder) TotalNumberPerPage(number int) *ListPublishBuilder
func (*ListPublishBuilder) WithValue ¶
func (b *ListPublishBuilder) WithValue(key, val interface{}) *ListPublishBuilder
type ListPublisher ¶
type OnePageItems ¶
type OnePageItems struct { Items []interface{} PageNumber int }
type PublishAction ¶
type PublishInterface ¶
type PublishInterface interface {
GetPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (actions []*PublishAction, err error)
}
type Schedule ¶
type Schedule struct { ScheduledStartAt *time.Time `gorm:"index"` ScheduledEndAt *time.Time `gorm:"index"` ActualStartAt *time.Time ActualEndAt *time.Time }
func (Schedule) GetPublishedAt ¶
func (Schedule) GetScheduledEndAt ¶
func (Schedule) GetScheduledStartAt ¶
func (Schedule) GetUnPublishedAt ¶
func (*Schedule) SetPublishedAt ¶
func (*Schedule) SetScheduledEndAt ¶
func (*Schedule) SetScheduledStartAt ¶
func (*Schedule) SetUnPublishedAt ¶
type ScheduleInterface ¶
type ScheduleInterface interface { GetStatus() string GetScheduledStartAt() *time.Time GetScheduledEndAt() *time.Time SetScheduledStartAt(v *time.Time) SetScheduledEndAt(v *time.Time) GetPublishedAt() *time.Time GetUnPublishedAt() *time.Time SetPublishedAt(v *time.Time) SetUnPublishedAt(v *time.Time) }
type SchedulePublishBuilder ¶
type SchedulePublishBuilder struct {
// contains filtered or unexported fields
}
func NewSchedulePublishBuilder ¶
func NewSchedulePublishBuilder(publisher *Builder) *SchedulePublishBuilder
func (*SchedulePublishBuilder) Run ¶
func (b *SchedulePublishBuilder) Run(model interface{}) (err error)
model is a empty struct example: Product{}
func (*SchedulePublishBuilder) WithValue ¶
func (b *SchedulePublishBuilder) WithValue(key, val interface{}) *SchedulePublishBuilder
type SchedulePublisher ¶
type StatusInterface ¶
type UnPublishInterface ¶
type UnPublishInterface interface {
GetUnPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (actions []*PublishAction, err error)
}
type Version ¶
type Version struct { Version string `gorm:"primary_key;size:128"` VersionName string ParentVersion string OnlineVersion bool `gorm:"index;default:false"` }
func (*Version) CreateVersion ¶
func (Version) GetVersion ¶
func (Version) GetVersionName ¶
func (*Version) SetVersion ¶
func (*Version) SetVersionName ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.