Documentation
¶
Index ¶
- Variables
- 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
- 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
- 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
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidTransactionError = errors.New("invalid transaction, it is already committed or roll backed")
Functions ¶
func GetOpusVersion ¶
func GetPresentationByVersionID ¶
func GetPresentationByVersionID(versionID string) (*model.OpusPresentation, bool)
func ListPresentations ¶
func ListReadmes ¶
func ListVersions ¶
Types ¶
type Option ¶
func ByIDOption ¶
func ByIDOption(id interface{}) Option
func OrderByOption ¶
func PageOption ¶
func WhereOption ¶
type TX ¶
type TX struct { Error error // contains filtered or unexported fields }
func (*TX) CommitOrRollback ¶
func (tx *TX) CommitOrRollback()
func (*TX) CreateInBatches ¶
Click to show internal directories.
Click to hide internal directories.