Documentation ¶
Index ¶
- 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) (*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) SetToken(ctx context.Context, key crypto.PubKey, token thread.Token) error
- func (a *Accounts) ValidateUsername(username string) error
- 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 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 User
- type Users
Constants ¶
This section is empty.
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 NewAPIKeyContext ¶ added in v1.0.0
func NewDevContext ¶ added in v1.0.0
func NewOrgContext ¶ added in v1.0.0
func NewSessionContext ¶ added in v1.0.0
Types ¶
type APIKey ¶ added in v1.0.0
type APIKeyType ¶ added in v1.0.0
type APIKeyType int
const ( AccountKey APIKeyType = iota UserKey )
type APIKeys ¶ added in v1.0.0
type APIKeys struct {
// contains filtered or unexported fields
}
func NewAPIKeys ¶ added in v1.0.0
func (*APIKeys) DeleteByOwner ¶ added in v1.0.2
func (*APIKeys) Invalidate ¶ added in v1.0.0
type Account ¶ added in v1.0.0
type Accounts ¶ added in v1.0.0
type Accounts struct {
// contains filtered or unexported fields
}
func NewAccounts ¶ added in v1.0.0
func (*Accounts) GetByUsername ¶ added in v1.0.0
func (*Accounts) GetByUsernameOrEmail ¶ added in v1.0.0
func (*Accounts) IsNameAvailable ¶ added in v1.0.0
func (*Accounts) IsUsernameAvailable ¶ added in v1.0.0
func (*Accounts) ListByMember ¶ added in v1.0.2
func (*Accounts) ListByOwner ¶ added in v1.0.2
func (*Accounts) ListMembers ¶ added in v1.0.0
func (*Accounts) RemoveMember ¶ added in v1.0.0
func (*Accounts) ValidateUsername ¶ added in v1.0.0
type Collections ¶
type Collections struct { Sessions *Sessions Accounts *Accounts Invites *Invites Threads *Threads APIKeys *APIKeys IPNSKeys *IPNSKeys Users *Users // contains filtered or unexported fields }
func NewCollections ¶
func NewCollections(ctx context.Context, uri, dbName string) (*Collections, error)
NewCollections gets or create store instances for active collections.
func (*Collections) Close ¶ added in v1.0.0
func (c *Collections) Close() error
type IPNSKeys ¶ added in v1.0.0
type IPNSKeys struct {
// contains filtered or unexported fields
}
func NewIPNSKeys ¶ added in v1.0.0
type Invites ¶
type Invites struct {
// contains filtered or unexported fields
}
func NewInvites ¶ added in v1.0.0
func (*Invites) DeleteByFrom ¶ added in v1.0.2
func (*Invites) DeleteByFromAndOrg ¶ added in v1.0.2
func (*Invites) DeleteByOrg ¶ added in v1.0.2
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
func NewSessions ¶ added in v1.0.0
func (*Sessions) DeleteByOwner ¶ added in v1.0.2
type Threads ¶ added in v1.0.0
type Threads struct {
// contains filtered or unexported fields
}
func NewThreads ¶ added in v1.0.0
func (*Threads) DeleteByOwner ¶ added in v1.0.2
Click to show internal directories.
Click to hide internal directories.