Documentation ¶
Index ¶
- Constants
- Variables
- func NewAPIKeyContext(ctx context.Context, key *APIKey) context.Context
- func NewDevContext(ctx context.Context, dev *Account) context.Context
- func NewOrgContext(ctx context.Context, org *Account) context.Context
- func NewSessionContext(ctx context.Context, session *Session) context.Context
- func NewUserContext(ctx context.Context, user *User) context.Context
- type APIKey
- type APIKeyType
- type APIKeys
- func (k *APIKeys) Create(ctx context.Context, owner thread.PubKey, keyType APIKeyType, secure bool) (*APIKey, error)
- func (k *APIKeys) DeleteByOwner(ctx context.Context, owner thread.PubKey) error
- func (k *APIKeys) Get(ctx context.Context, key string) (*APIKey, error)
- func (k *APIKeys) Invalidate(ctx context.Context, key string) error
- func (k *APIKeys) ListByOwner(ctx context.Context, owner thread.PubKey) ([]APIKey, error)
- type Account
- type AccountType
- type Accounts
- func (a *Accounts) AddMember(ctx context.Context, username string, member Member) error
- func (a *Accounts) CreateDev(ctx context.Context, username, email string, powInfo *PowInfo) (*Account, error)
- func (a *Accounts) CreateOrg(ctx context.Context, name string, members []Member, powInfo *PowInfo) (*Account, error)
- func (a *Accounts) Delete(ctx context.Context, key thread.PubKey) error
- func (a *Accounts) Get(ctx context.Context, key thread.PubKey) (*Account, error)
- func (a *Accounts) GetByUsername(ctx context.Context, username string) (*Account, error)
- func (a *Accounts) GetByUsernameOrEmail(ctx context.Context, usernameOrEmail string) (*Account, error)
- func (a *Accounts) IsMember(ctx context.Context, username string, member thread.PubKey) (bool, error)
- func (a *Accounts) IsNameAvailable(ctx context.Context, name string) (s string, err error)
- func (a *Accounts) IsOwner(ctx context.Context, username string, member thread.PubKey) (bool, error)
- func (a *Accounts) IsUsernameAvailable(ctx context.Context, username string) error
- func (a *Accounts) ListByMember(ctx context.Context, member thread.PubKey) ([]Account, error)
- func (a *Accounts) ListByOwner(ctx context.Context, owner thread.PubKey) ([]Account, error)
- func (a *Accounts) ListMembers(ctx context.Context, members []Member) ([]Account, error)
- func (a *Accounts) RemoveMember(ctx context.Context, username string, member thread.PubKey) error
- func (a *Accounts) SetBucketsTotalSize(ctx context.Context, key thread.PubKey, newTotalSize int64) error
- func (a *Accounts) SetToken(ctx context.Context, key thread.PubKey, token thread.Token) error
- func (a *Accounts) UpdatePowInfo(ctx context.Context, key thread.PubKey, powInfo *PowInfo) (*Account, error)
- func (a *Accounts) ValidateUsername(username string) error
- type Archive
- type ArchiveTracking
- func (at *ArchiveTracking) Create(ctx context.Context, dbID thread.ID, dbToken thread.Token, bucketKey string, ...) error
- func (at *ArchiveTracking) Finalize(ctx context.Context, jid ffs.JobID, cause string) error
- func (at *ArchiveTracking) Get(ctx context.Context, jid ffs.JobID) (*TrackedArchive, error)
- func (at *ArchiveTracking) GetReadyToCheck(ctx context.Context, n int64) ([]*TrackedArchive, error)
- func (at *ArchiveTracking) Reschedule(ctx context.Context, jid ffs.JobID, dur time.Duration, cause string) error
- type Archives
- type BucketArchive
- type BucketArchives
- type Collections
- type IPNSKey
- type IPNSKeys
- func (k *IPNSKeys) Create(ctx context.Context, name, cid string, threadID thread.ID) error
- func (k *IPNSKeys) Delete(ctx context.Context, name string) error
- func (k *IPNSKeys) Get(ctx context.Context, name string) (*IPNSKey, error)
- func (k *IPNSKeys) GetByCid(ctx context.Context, cid string) (*IPNSKey, error)
- func (k *IPNSKeys) ListByThreadID(ctx context.Context, threadID thread.ID) ([]IPNSKey, error)
- type Invite
- type Invites
- func (i *Invites) Accept(ctx context.Context, token string) error
- func (i *Invites) Create(ctx context.Context, from thread.PubKey, org, emailTo string) (*Invite, error)
- func (i *Invites) Delete(ctx context.Context, token string) error
- func (i *Invites) DeleteByFrom(ctx context.Context, from thread.PubKey) error
- func (i *Invites) DeleteByFromAndOrg(ctx context.Context, from thread.PubKey, org string) error
- func (i *Invites) DeleteByOrg(ctx context.Context, org string) error
- func (i *Invites) Get(ctx context.Context, token string) (*Invite, error)
- func (i *Invites) ListByEmail(ctx context.Context, email string) ([]Invite, error)
- type Member
- type PowInfo
- type Role
- type Session
- type Sessions
- func (s *Sessions) Create(ctx context.Context, owner thread.PubKey) (*Session, error)
- func (s *Sessions) Delete(ctx context.Context, id string) error
- func (s *Sessions) DeleteByOwner(ctx context.Context, owner thread.PubKey) error
- func (s *Sessions) Get(ctx context.Context, id string) (*Session, error)
- func (s *Sessions) Touch(ctx context.Context, id string) error
- type Thread
- type Threads
- func (t *Threads) Create(ctx context.Context, id thread.ID, owner thread.PubKey, isDB bool) (*Thread, error)
- func (t *Threads) Delete(ctx context.Context, id thread.ID, owner thread.PubKey) error
- func (t *Threads) DeleteByOwner(ctx context.Context, owner thread.PubKey) error
- func (t *Threads) Get(ctx context.Context, id thread.ID, owner thread.PubKey) (*Thread, error)
- func (t *Threads) GetByName(ctx context.Context, name string, owner thread.PubKey) (*Thread, error)
- func (t *Threads) ListByKey(ctx context.Context, key string) ([]Thread, error)
- func (t *Threads) ListByOwner(ctx context.Context, owner thread.PubKey) ([]Thread, error)
- type TrackedArchive
- type User
- type Users
- func (u *Users) Create(ctx context.Context, key thread.PubKey, powInfo *PowInfo) error
- func (u *Users) Delete(ctx context.Context, key thread.PubKey) error
- func (u *Users) Get(ctx context.Context, key thread.PubKey) (*User, error)
- func (u *Users) SetBucketsTotalSize(ctx context.Context, key thread.PubKey, newTotalSize int64) error
- func (u *Users) UpdatePowInfo(ctx context.Context, key thread.PubKey, powInfo *PowInfo) (*User, error)
Constants ¶
View Source
const (
DuplicateErrMsg = "E11000 duplicate key error"
)
Variables ¶
View Source
var (
ErrInvalidThreadName = fmt.Errorf("name may only contain alphanumeric characters or non-consecutive hyphens, and cannot begin or end with a hyphen")
)
View Source
var (
ErrInvalidUsername = fmt.Errorf("username may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen")
)
Functions ¶
func NewSessionContext ¶
Types ¶
type APIKey ¶
type APIKeys ¶
type APIKeys struct {
// contains filtered or unexported fields
}
func (*APIKeys) DeleteByOwner ¶
type Account ¶
type Accounts ¶
type Accounts struct {
// contains filtered or unexported fields
}
func (*Accounts) GetByUsername ¶
func (*Accounts) GetByUsernameOrEmail ¶
func (*Accounts) IsNameAvailable ¶
func (*Accounts) IsUsernameAvailable ¶
func (*Accounts) ListByMember ¶
func (*Accounts) ListByOwner ¶
func (*Accounts) ListMembers ¶
func (*Accounts) RemoveMember ¶
func (*Accounts) SetBucketsTotalSize ¶
func (*Accounts) UpdatePowInfo ¶
func (*Accounts) ValidateUsername ¶
type ArchiveTracking ¶
type ArchiveTracking struct {
// contains filtered or unexported fields
}
func NewArchiveTracking ¶
func (*ArchiveTracking) Get ¶
func (at *ArchiveTracking) Get(ctx context.Context, jid ffs.JobID) (*TrackedArchive, error)
func (*ArchiveTracking) GetReadyToCheck ¶
func (at *ArchiveTracking) GetReadyToCheck(ctx context.Context, n int64) ([]*TrackedArchive, error)
type BucketArchive ¶
type BucketArchives ¶
type BucketArchives struct {
// contains filtered or unexported fields
}
func NewBucketArchives ¶
func (*BucketArchives) Create ¶
func (k *BucketArchives) Create(ctx context.Context, bucketKey string) (*BucketArchive, error)
func (*BucketArchives) GetOrCreate ¶
func (k *BucketArchives) GetOrCreate(ctx context.Context, bucketKey string) (*BucketArchive, error)
func (*BucketArchives) Replace ¶
func (k *BucketArchives) Replace(ctx context.Context, ba *BucketArchive) error
type Collections ¶
type Collections struct { Sessions *Sessions Accounts *Accounts Invites *Invites Threads *Threads APIKeys *APIKeys IPNSKeys *IPNSKeys BucketArchives *BucketArchives ArchiveTracking *ArchiveTracking Users *Users // contains filtered or unexported fields }
func NewCollections ¶
NewCollections gets or create store instances for active collections.
func (*Collections) Close ¶
func (c *Collections) Close() error
type IPNSKeys ¶
type IPNSKeys struct {
// contains filtered or unexported fields
}
type Invites ¶
type Invites struct {
// contains filtered or unexported fields
}
func (*Invites) DeleteByFrom ¶
func (*Invites) DeleteByFromAndOrg ¶
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
func (*Sessions) DeleteByOwner ¶
type Threads ¶
type Threads struct {
// contains filtered or unexported fields
}
func (*Threads) DeleteByOwner ¶
type TrackedArchive ¶
Click to show internal directories.
Click to hide internal directories.