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 crypto.PubKey, keyType APIKeyType, secure bool) (*APIKey, error)
- func (k *APIKeys) DeleteByOwner(ctx context.Context, owner crypto.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 crypto.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) (*Account, error)
- func (a *Accounts) CreateOrg(ctx context.Context, name string, members []Member) (*Account, error)
- func (a *Accounts) Delete(ctx context.Context, key crypto.PubKey) error
- func (a *Accounts) Get(ctx context.Context, key crypto.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 crypto.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 crypto.PubKey) (bool, error)
- func (a *Accounts) IsUsernameAvailable(ctx context.Context, username string) error
- func (a *Accounts) ListByMember(ctx context.Context, member crypto.PubKey) ([]Account, error)
- func (a *Accounts) ListByOwner(ctx context.Context, owner crypto.PubKey) ([]Account, error)
- func (a *Accounts) ListMembers(ctx context.Context, members []Member) ([]Account, error)
- func (a *Accounts) RemoveMember(ctx context.Context, username string, member crypto.PubKey) error
- func (a *Accounts) SetBucketsTotalSize(ctx context.Context, key crypto.PubKey, newTotalSize int64) error
- func (a *Accounts) SetToken(ctx context.Context, key crypto.PubKey, token thread.Token) 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 Collections
- type FFSInstance
- type FFSInstances
- 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 crypto.PubKey, org, emailTo string) (*Invite, error)
- func (i *Invites) Delete(ctx context.Context, token string) error
- func (i *Invites) DeleteByFrom(ctx context.Context, from crypto.PubKey) error
- func (i *Invites) DeleteByFromAndOrg(ctx context.Context, from crypto.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 Role
- type Session
- type Sessions
- func (s *Sessions) Create(ctx context.Context, owner crypto.PubKey) (*Session, error)
- func (s *Sessions) Delete(ctx context.Context, id string) error
- func (s *Sessions) DeleteByOwner(ctx context.Context, owner crypto.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 crypto.PubKey, isDB bool) (*Thread, error)
- func (t *Threads) Delete(ctx context.Context, id thread.ID, owner crypto.PubKey) error
- func (t *Threads) DeleteByOwner(ctx context.Context, owner crypto.PubKey) error
- func (t *Threads) Get(ctx context.Context, id thread.ID, owner crypto.PubKey) (*Thread, error)
- func (t *Threads) GetByName(ctx context.Context, name string, owner crypto.PubKey) (*Thread, error)
- func (t *Threads) ListByKey(ctx context.Context, key string) ([]Thread, error)
- func (t *Threads) ListByOwner(ctx context.Context, owner crypto.PubKey) ([]Thread, error)
- type TrackedArchive
- type User
- type Users
- func (u *Users) Create(ctx context.Context, key crypto.PubKey) error
- func (u *Users) Delete(ctx context.Context, key crypto.PubKey) error
- func (u *Users) Get(ctx context.Context, key crypto.PubKey) (*User, error)
- func (u *Users) SetBucketsTotalSize(ctx context.Context, key crypto.PubKey, newTotalSize int64) 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) 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 Collections ¶
type Collections struct { Sessions *Sessions Accounts *Accounts Invites *Invites Threads *Threads APIKeys *APIKeys IPNSKeys *IPNSKeys FFSInstances *FFSInstances 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 FFSInstance ¶
type FFSInstances ¶
type FFSInstances struct {
// contains filtered or unexported fields
}
func NewFFSInstances ¶
func (*FFSInstances) Create ¶
func (k *FFSInstances) Create(ctx context.Context, bucketKey, ffsToken, waddr string) error
func (*FFSInstances) Get ¶
func (k *FFSInstances) Get(ctx context.Context, bucketKey string) (*FFSInstance, error)
func (*FFSInstances) Replace ¶
func (k *FFSInstances) Replace(ctx context.Context, ffs *FFSInstance) 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.