Documentation ¶
Index ¶
- Variables
- type AuthToken
- type AuthTokensQuery
- type ClaimedInvite
- type Collection
- type CollectionID
- type CollectionRef
- type CollectionRefID
- type CollectionRefsQuery
- type CollectionsQuery
- type Content
- type ContentID
- type ContentsQuery
- func (q *ContentsQuery) Count() (int64, error)
- func (q *ContentsQuery) CreateAll(contents []Content) error
- func (q *ContentsQuery) Delete() error
- func (q *ContentsQuery) Get() (Content, error)
- func (q *ContentsQuery) GetAll() ([]Content, error)
- func (q *ContentsQuery) Limit(limit int) *ContentsQuery
- func (q *ContentsQuery) Offset(offset int) *ContentsQuery
- func (q *ContentsQuery) OrderByCreationDate(order DBSortOrder) *ContentsQuery
- func (q *ContentsQuery) OrderByID(order DBSortOrder) *ContentsQuery
- func (q *ContentsQuery) WithActive(active bool) *ContentsQuery
- func (q *ContentsQuery) WithAggregate(aggregate bool) *ContentsQuery
- func (q *ContentsQuery) WithAggregatedIn(contentID uint) *ContentsQuery
- func (q *ContentsQuery) WithCid(cid gocid.Cid) *ContentsQuery
- func (q *ContentsQuery) WithCids(cids []gocid.Cid) *ContentsQuery
- func (q *ContentsQuery) WithID(id uint) *ContentsQuery
- func (q *ContentsQuery) WithUserID(userID uint) *ContentsQuery
- type DBMgr
- func (mgr *DBMgr) AuthTokens() *AuthTokensQuery
- func (mgr *DBMgr) CollectionRefs() *CollectionRefsQuery
- func (mgr *DBMgr) Collections() *CollectionsQuery
- func (mgr *DBMgr) Contents() *ContentsQuery
- func (mgr *DBMgr) DFERecords() *DFERecordsQuery
- func (mgr *DBMgr) Deals() *DealsQuery
- func (mgr *DBMgr) InviteCodes() *InviteCodesQuery
- func (mgr *DBMgr) MinerStorageAsks() *MinerStorageAsksQuery
- func (mgr *DBMgr) ObjRefs() *ObjRefsQuery
- func (mgr *DBMgr) Objects() *ObjectsQuery
- func (mgr *DBMgr) PieceCommRecords() *PieceCommRecordsQuery
- func (mgr *DBMgr) ProposalRecords() *ProposalRecordsQuery
- func (mgr *DBMgr) RetrievalFailureRecords() *RetrievalFailureRecordsQuery
- func (mgr *DBMgr) RetrievalSuccessRecords() *RetrievalSuccessRecordsQuery
- func (mgr *DBMgr) Shuttles() *ShuttlesQuery
- func (mgr *DBMgr) StorageMiners() *StorageMinersQuery
- func (mgr *DBMgr) Users() *UsersQuery
- type DBSortOrder
- type DFERecord
- type DFERecordsQuery
- type Deal
- type DealID
- type DealsQuery
- func (q *DealsQuery) Count() (int64, error)
- func (q *DealsQuery) Get() (Deal, error)
- func (q *DealsQuery) GetAll() ([]Deal, error)
- func (q *DealsQuery) WithContentID(contentID uint) *DealsQuery
- func (q *DealsQuery) WithContentIDs(contentIDs []uint) *DealsQuery
- func (q *DealsQuery) WithDealOnChain(valid bool) *DealsQuery
- func (q *DealsQuery) WithFailed(failed bool) *DealsQuery
- func (q *DealsQuery) WithID(id uint) *DealsQuery
- func (q *DealsQuery) WithPropCid(propCid gocid.Cid) *DealsQuery
- type InviteCode
- type InviteCodeID
- type InviteCodesQuery
- type MinerStorageAsk
- type MinerStorageAskID
- type MinerStorageAsksQuery
- type ObjRef
- type ObjRefID
- type ObjRefStats
- type ObjRefsQuery
- type Object
- type ObjectID
- type ObjectsQuery
- type PieceCommRecord
- type PieceCommRecordsQuery
- type ProposalRecord
- type ProposalRecordsQuery
- type RetrievalFailureRecord
- type RetrievalFailureRecordID
- type RetrievalFailureRecordsQuery
- type RetrievalSuccessRecord
- type RetrievalSuccessRecordID
- type RetrievalSuccessRecordsQuery
- type Shuttle
- type ShuttleID
- type ShuttlesQuery
- type StorageMiner
- type StorageMinerID
- type StorageMinersQuery
- func (q *StorageMinersQuery) Count() (int64, error)
- func (q *StorageMinersQuery) Delete() error
- func (q *StorageMinersQuery) Get() (StorageMiner, error)
- func (q *StorageMinersQuery) GetAll() ([]StorageMiner, error)
- func (q *StorageMinersQuery) SetName(name string) error
- func (q *StorageMinersQuery) WithAddress(addr address.Address) *StorageMinersQuery
- type User
- type UserID
- type UsersQuery
- func (q *UsersQuery) Count() (int64, error)
- func (q *UsersQuery) Create(user User) error
- func (q *UsersQuery) Exists() (bool, error)
- func (q *UsersQuery) ExpectDelete() error
- func (q *UsersQuery) Get() (User, error)
- func (q *UsersQuery) WithID(id uint) *UsersQuery
- func (q *UsersQuery) WithUsername(username string) *UsersQuery
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFiltered = errors.New("actions requires query to be filtered, but no filters were applied")
)
Functions ¶
This section is empty.
Types ¶
type AuthTokensQuery ¶
func NewAuthTokensQuery ¶
func NewAuthTokensQuery(db *gorm.DB) *AuthTokensQuery
func (*AuthTokensQuery) Create ¶
func (q *AuthTokensQuery) Create(authToken AuthToken) error
type ClaimedInvite ¶
type Collection ¶
type CollectionID ¶
type CollectionID uint
type CollectionRef ¶
type CollectionRef struct { ID CollectionRefID `gorm:"primarykey"` CreatedAt time.Time Collection CollectionID Content ContentID }
type CollectionRefID ¶
type CollectionRefID uint
type CollectionRefsQuery ¶
func NewCollectionRefsQuery ¶
func NewCollectionRefsQuery(db *gorm.DB) *CollectionRefsQuery
func (*CollectionRefsQuery) Create ¶
func (q *CollectionRefsQuery) Create(collectionRef CollectionRef) error
type CollectionsQuery ¶
func NewCollectionsQuery ¶
func NewCollectionsQuery(db *gorm.DB) *CollectionsQuery
func (*CollectionsQuery) Get ¶
func (q *CollectionsQuery) Get() (Collection, error)
func (*CollectionsQuery) WithUUID ¶
func (q *CollectionsQuery) WithUUID(uuid string) *CollectionsQuery
func (*CollectionsQuery) WithUserID ¶
func (q *CollectionsQuery) WithUserID(userID uint) *CollectionsQuery
type Content ¶
type Content struct { ID uint `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` Cid util.DbCID Filename string UserID UserID Description string Size int64 Type util.ContentType Active bool Offloaded bool Replication int AggregatedIn ContentID Aggregate bool Pinning bool PinMeta string Failed bool Location string }
type ContentsQuery ¶
func NewContentsQuery ¶
func NewContentsQuery(db *gorm.DB) *ContentsQuery
func (*ContentsQuery) Count ¶
func (q *ContentsQuery) Count() (int64, error)
func (*ContentsQuery) CreateAll ¶
func (q *ContentsQuery) CreateAll(contents []Content) error
func (*ContentsQuery) Delete ¶
func (q *ContentsQuery) Delete() error
func (*ContentsQuery) Get ¶
func (q *ContentsQuery) Get() (Content, error)
func (*ContentsQuery) GetAll ¶
func (q *ContentsQuery) GetAll() ([]Content, error)
func (*ContentsQuery) Limit ¶
func (q *ContentsQuery) Limit(limit int) *ContentsQuery
func (*ContentsQuery) Offset ¶
func (q *ContentsQuery) Offset(offset int) *ContentsQuery
func (*ContentsQuery) OrderByCreationDate ¶
func (q *ContentsQuery) OrderByCreationDate(order DBSortOrder) *ContentsQuery
TODO: order functions can probably be simplified
func (*ContentsQuery) OrderByID ¶
func (q *ContentsQuery) OrderByID(order DBSortOrder) *ContentsQuery
func (*ContentsQuery) WithActive ¶
func (q *ContentsQuery) WithActive(active bool) *ContentsQuery
func (*ContentsQuery) WithAggregate ¶
func (q *ContentsQuery) WithAggregate(aggregate bool) *ContentsQuery
func (*ContentsQuery) WithAggregatedIn ¶
func (q *ContentsQuery) WithAggregatedIn(contentID uint) *ContentsQuery
func (*ContentsQuery) WithCid ¶
func (q *ContentsQuery) WithCid(cid gocid.Cid) *ContentsQuery
func (*ContentsQuery) WithCids ¶
func (q *ContentsQuery) WithCids(cids []gocid.Cid) *ContentsQuery
func (*ContentsQuery) WithID ¶
func (q *ContentsQuery) WithID(id uint) *ContentsQuery
func (*ContentsQuery) WithUserID ¶
func (q *ContentsQuery) WithUserID(userID uint) *ContentsQuery
type DBMgr ¶
func (*DBMgr) AuthTokens ¶
func (mgr *DBMgr) AuthTokens() *AuthTokensQuery
func (*DBMgr) CollectionRefs ¶
func (mgr *DBMgr) CollectionRefs() *CollectionRefsQuery
func (*DBMgr) Collections ¶
func (mgr *DBMgr) Collections() *CollectionsQuery
func (*DBMgr) Contents ¶
func (mgr *DBMgr) Contents() *ContentsQuery
func (*DBMgr) DFERecords ¶
func (mgr *DBMgr) DFERecords() *DFERecordsQuery
func (*DBMgr) Deals ¶
func (mgr *DBMgr) Deals() *DealsQuery
func (*DBMgr) InviteCodes ¶
func (mgr *DBMgr) InviteCodes() *InviteCodesQuery
func (*DBMgr) MinerStorageAsks ¶
func (mgr *DBMgr) MinerStorageAsks() *MinerStorageAsksQuery
func (*DBMgr) ObjRefs ¶
func (mgr *DBMgr) ObjRefs() *ObjRefsQuery
func (*DBMgr) Objects ¶
func (mgr *DBMgr) Objects() *ObjectsQuery
func (*DBMgr) PieceCommRecords ¶
func (mgr *DBMgr) PieceCommRecords() *PieceCommRecordsQuery
func (*DBMgr) ProposalRecords ¶
func (mgr *DBMgr) ProposalRecords() *ProposalRecordsQuery
func (*DBMgr) RetrievalFailureRecords ¶
func (mgr *DBMgr) RetrievalFailureRecords() *RetrievalFailureRecordsQuery
func (*DBMgr) RetrievalSuccessRecords ¶
func (mgr *DBMgr) RetrievalSuccessRecords() *RetrievalSuccessRecordsQuery
func (*DBMgr) Shuttles ¶
func (mgr *DBMgr) Shuttles() *ShuttlesQuery
func (*DBMgr) StorageMiners ¶
func (mgr *DBMgr) StorageMiners() *StorageMinersQuery
func (*DBMgr) Users ¶
func (mgr *DBMgr) Users() *UsersQuery
type DBSortOrder ¶
type DBSortOrder int
const ( OrderDescending DBSortOrder = 0 OrderAscending DBSortOrder = 1 )
type DFERecordsQuery ¶
func NewDFERecordsQuery ¶
func NewDFERecordsQuery(db *gorm.DB) *DFERecordsQuery
func (*DFERecordsQuery) Count ¶
func (q *DFERecordsQuery) Count() (int64, error)
func (*DFERecordsQuery) WithContent ¶
func (q *DFERecordsQuery) WithContent(contentID uint) *DFERecordsQuery
type DealsQuery ¶
func NewDealsQuery ¶
func NewDealsQuery(db *gorm.DB) *DealsQuery
func (*DealsQuery) Count ¶
func (q *DealsQuery) Count() (int64, error)
func (*DealsQuery) Get ¶
func (q *DealsQuery) Get() (Deal, error)
func (*DealsQuery) GetAll ¶
func (q *DealsQuery) GetAll() ([]Deal, error)
func (*DealsQuery) WithContentID ¶
func (q *DealsQuery) WithContentID(contentID uint) *DealsQuery
func (*DealsQuery) WithContentIDs ¶
func (q *DealsQuery) WithContentIDs(contentIDs []uint) *DealsQuery
func (*DealsQuery) WithDealOnChain ¶
func (q *DealsQuery) WithDealOnChain(valid bool) *DealsQuery
func (*DealsQuery) WithFailed ¶
func (q *DealsQuery) WithFailed(failed bool) *DealsQuery
func (*DealsQuery) WithID ¶
func (q *DealsQuery) WithID(id uint) *DealsQuery
func (*DealsQuery) WithPropCid ¶
func (q *DealsQuery) WithPropCid(propCid gocid.Cid) *DealsQuery
type InviteCode ¶
type InviteCodeID ¶
type InviteCodeID uint
type InviteCodesQuery ¶
func NewInviteCodesQuery ¶
func NewInviteCodesQuery(db *gorm.DB) *InviteCodesQuery
func (*InviteCodesQuery) Create ¶
func (q *InviteCodesQuery) Create(invite InviteCode) error
func (*InviteCodesQuery) GetClaimedInvites ¶
func (q *InviteCodesQuery) GetClaimedInvites() ([]ClaimedInvite, error)
type MinerStorageAsk ¶
type MinerStorageAsk struct { gorm.Model Miner string `gorm:"unique"` Price string VerifiedPrice string MinPieceSize abi.PaddedPieceSize MaxPieceSize abi.PaddedPieceSize }
type MinerStorageAskID ¶
type MinerStorageAskID uint
type MinerStorageAsksQuery ¶
func NewMinerStorageAsksQuery ¶
func NewMinerStorageAsksQuery(db *gorm.DB) *MinerStorageAsksQuery
type ObjRefStats ¶
type ObjRefsQuery ¶
func NewObjRefsQuery ¶
func NewObjRefsQuery(db *gorm.DB) *ObjRefsQuery
func (*ObjRefsQuery) Delete ¶
func (q *ObjRefsQuery) Delete() error
func (*ObjRefsQuery) GetStats ¶
func (q *ObjRefsQuery) GetStats() (ObjRefStats, error)
func (*ObjRefsQuery) WithContentID ¶
func (q *ObjRefsQuery) WithContentID(contentID uint) *ObjRefsQuery
func (*ObjRefsQuery) WithPinID ¶
func (q *ObjRefsQuery) WithPinID(pinID uint) *ObjRefsQuery
type ObjectsQuery ¶
func NewObjectsQuery ¶
func NewObjectsQuery(db *gorm.DB) *ObjectsQuery
func (*ObjectsQuery) Count ¶
func (q *ObjectsQuery) Count() (int64, error)
func (*ObjectsQuery) DeleteUnreferenced ¶
func (q *ObjectsQuery) DeleteUnreferenced(ids []uint) error
TODO: simplify by using other abstracted functions instead
func (*ObjectsQuery) Exists ¶
func (q *ObjectsQuery) Exists() (bool, error)
func (*ObjectsQuery) WithCid ¶
func (q *ObjectsQuery) WithCid(cid gocid.Cid) *ObjectsQuery
type PieceCommRecord ¶
type PieceCommRecordsQuery ¶
func NewPieceCommRecordsQuery ¶
func NewPieceCommRecordsQuery(db *gorm.DB) *PieceCommRecordsQuery
type ProposalRecord ¶
type ProposalRecordsQuery ¶
func NewProposalRecordsQuery ¶
func NewProposalRecordsQuery(db *gorm.DB) *ProposalRecordsQuery
func (*ProposalRecordsQuery) Get ¶
func (q *ProposalRecordsQuery) Get() (ProposalRecord, error)
func (*ProposalRecordsQuery) WithPropCid ¶
func (q *ProposalRecordsQuery) WithPropCid(cid gocid.Cid) *ProposalRecordsQuery
type RetrievalFailureRecord ¶
type RetrievalFailureRecordID ¶
type RetrievalFailureRecordID uint
type RetrievalFailureRecordsQuery ¶
func NewRetrievalFailureRecordsQuery ¶
func NewRetrievalFailureRecordsQuery(db *gorm.DB) *RetrievalFailureRecordsQuery
func (*RetrievalFailureRecordsQuery) Count ¶
func (q *RetrievalFailureRecordsQuery) Count() (int64, error)
type RetrievalSuccessRecord ¶
type RetrievalSuccessRecordID ¶
type RetrievalSuccessRecordID uint
type RetrievalSuccessRecordsQuery ¶
func NewRetrievalSuccessRecordsQuery ¶
func NewRetrievalSuccessRecordsQuery(db *gorm.DB) *RetrievalSuccessRecordsQuery
func (*RetrievalSuccessRecordsQuery) Count ¶
func (q *RetrievalSuccessRecordsQuery) Count() (int64, error)
type ShuttlesQuery ¶
func NewShuttlesQuery ¶
func NewShuttlesQuery(db *gorm.DB) *ShuttlesQuery
type StorageMiner ¶
type StorageMinerID ¶
type StorageMinerID uint
type StorageMinersQuery ¶
func NewStorageMinersQuery ¶
func NewStorageMinersQuery(db *gorm.DB) *StorageMinersQuery
func (*StorageMinersQuery) Count ¶
func (q *StorageMinersQuery) Count() (int64, error)
func (*StorageMinersQuery) Delete ¶
func (q *StorageMinersQuery) Delete() error
func (*StorageMinersQuery) Get ¶
func (q *StorageMinersQuery) Get() (StorageMiner, error)
func (*StorageMinersQuery) GetAll ¶
func (q *StorageMinersQuery) GetAll() ([]StorageMiner, error)
func (*StorageMinersQuery) SetName ¶
func (q *StorageMinersQuery) SetName(name string) error
func (*StorageMinersQuery) WithAddress ¶
func (q *StorageMinersQuery) WithAddress(addr address.Address) *StorageMinersQuery
type UsersQuery ¶
func NewUsersQuery ¶
func NewUsersQuery(db *gorm.DB) *UsersQuery
func (*UsersQuery) Count ¶
func (q *UsersQuery) Count() (int64, error)
func (*UsersQuery) Create ¶
func (q *UsersQuery) Create(user User) error
func (*UsersQuery) Exists ¶
func (q *UsersQuery) Exists() (bool, error)
func (*UsersQuery) ExpectDelete ¶
func (q *UsersQuery) ExpectDelete() error
Errors if none were deleted
func (*UsersQuery) Get ¶
func (q *UsersQuery) Get() (User, error)
func (*UsersQuery) WithID ¶
func (q *UsersQuery) WithID(id uint) *UsersQuery
func (*UsersQuery) WithUsername ¶
func (q *UsersQuery) WithUsername(username string) *UsersQuery
Click to show internal directories.
Click to hide internal directories.