Versions in this module Expand all Collapse all v1 v1.0.1 Aug 15, 2024 Changes in this version + var InvalidTransactionError = errors.New("invalid transaction, it is already committed or roll backed") + func GetOpus(tx *TX, options ...Option) (*model.Opus, bool, error) + func GetOpusByID(tx *TX, id string) (*model.Opus, bool, error) + func GetOpusVersion(tx *TX, option ...Option) (*model.OpusVersion, bool, error) + func GetPresentationByVersionID(versionID string) (*model.OpusPresentation, bool) + func GetReadme(tx *TX, option ...Option) (*model.OpusReadme, bool, error) + func Init(db *gorm.DB) + func ListOpuses(tx *TX, options ...Option) (int64, []*model.Opus, error) + func ListPresentations(tx *TX, options ...Option) (int64, []*model.OpusPresentation, error) + func ListReadmes(tx *TX, options ...Option) (int64, []*model.OpusReadme, error) + func ListVersions(tx *TX, options ...Option) (int64, []*model.OpusVersion, error) + type Option interface + With func(db *gorm.DB) *gorm.DB + func ByIDOption(id interface{}) Option + func InOption(col string, values map[interface{}]struct{}) Option + func MapOption(m map[string]interface{}) Option + func OrderByOption(col string, order string) Option + func PageOption(pageSize, pageNo int) Option + func WhereOption(format string, args ...interface{}) Option + type TX struct + Error error + func Begin() *TX + func Q() *TX + func (tx *TX) CommitOrRollback() + func (tx *TX) Create(i interface{}) error + func (tx *TX) CreateInBatches(i interface{}, size int) error + func (tx *TX) DB() *gorm.DB + func (tx *TX) Delete(i interface{}, options ...Option) error + func (tx *TX) Get(i interface{}, options ...Option) (bool, error) + func (tx *TX) List(i interface{}, options ...Option) (int64, error) + func (tx *TX) Updates(i, v interface{}, options ...Option) error