Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type AccountBinding
- func (ab *AccountBinding) Email() (string, bool)
- func (ab *AccountBinding) ID() snowflake.Snowflake
- func (ab *AccountBinding) IsStaff() bool
- func (ab *AccountBinding) KeyFromPassword(password string) *security.ManagedKey
- func (ab *AccountBinding) KeyPair() security.ManagedKeyPair
- func (ab *AccountBinding) Name() string
- func (ab *AccountBinding) PersonalIdentities() []proto.PersonalIdentity
- func (ab *AccountBinding) SystemKey() security.ManagedKey
- func (ab *AccountBinding) Unlock(clientKey *security.ManagedKey) (*security.ManagedKeyPair, error)
- func (ab *AccountBinding) UnlockStaffKMS(clientKey *security.ManagedKey) (security.KMS, error)
- func (ab *AccountBinding) UserKey() security.ManagedKey
- func (ab *AccountBinding) View(roomName string) *proto.AccountView
- type AccountManagerBinding
- func (b *AccountManagerBinding) ChangeClientKey(ctx scope.Context, accountID snowflake.Snowflake, ...) error
- func (b *AccountManagerBinding) ChangeEmail(ctx scope.Context, accountID snowflake.Snowflake, email string) (bool, error)
- func (b *AccountManagerBinding) ChangeName(ctx scope.Context, accountID snowflake.Snowflake, name string) error
- func (b *AccountManagerBinding) ConfirmPasswordReset(ctx scope.Context, kms security.KMS, confirmation, password string) error
- func (b *AccountManagerBinding) GenerateOTP(ctx scope.Context, heim *proto.Heim, kms security.KMS, account proto.Account) (*proto.OTP, error)
- func (b *AccountManagerBinding) Get(ctx scope.Context, id snowflake.Snowflake) (proto.Account, error)
- func (b *AccountManagerBinding) GetPasswordResetAccount(ctx scope.Context, confirmation string) (proto.Account, error)
- func (b *AccountManagerBinding) GrantStaff(ctx scope.Context, accountID snowflake.Snowflake, ...) error
- func (b *AccountManagerBinding) OTP(ctx scope.Context, kms security.KMS, accountID snowflake.Snowflake) (*proto.OTP, error)
- func (b *AccountManagerBinding) Register(ctx scope.Context, kms security.KMS, namespace, id, password string, ...) (proto.Account, *security.ManagedKey, error)
- func (b *AccountManagerBinding) RequestPasswordReset(ctx scope.Context, kms security.KMS, namespace, id string) (proto.Account, *proto.PasswordResetRequest, error)
- func (b *AccountManagerBinding) Resolve(ctx scope.Context, namespace, id string) (proto.Account, error)
- func (b *AccountManagerBinding) RevokeStaff(ctx scope.Context, accountID snowflake.Snowflake) error
- func (b *AccountManagerBinding) SetUserKey(ctx scope.Context, accountID snowflake.Snowflake, key *security.ManagedKey) error
- func (b *AccountManagerBinding) ValidateOTP(ctx scope.Context, kms security.KMS, accountID snowflake.Snowflake, ...) error
- func (b *AccountManagerBinding) VerifyPersonalIdentity(ctx scope.Context, namespace, id string) error
- type AccountWithStaffCapability
- type Agent
- type AgentTrackerBinding
- func (atb *AgentTrackerBinding) ClearClientKey(ctx scope.Context, agentID string) error
- func (atb *AgentTrackerBinding) Get(ctx scope.Context, agentID string) (*proto.Agent, error)
- func (atb *AgentTrackerBinding) Register(ctx scope.Context, agent *proto.Agent) error
- func (atb *AgentTrackerBinding) SetClientKey(ctx scope.Context, agentID string, accessKey *security.ManagedKey, ...) error
- type Backend
- func (b *Backend) AccountManager() proto.AccountManager
- func (b *Backend) AgentTracker() proto.AgentTracker
- func (b *Backend) Ban(ctx scope.Context, ban proto.Ban, until time.Time) error
- func (b *Backend) Close()
- func (b *Backend) CreateRoom(ctx scope.Context, kms security.KMS, private bool, name string, ...) (proto.ManagedRoom, error)
- func (b *Backend) EmailTracker() proto.EmailTracker
- func (b *Backend) GetRoom(ctx scope.Context, name string) (proto.ManagedRoom, error)
- func (b *Backend) Jobs() jobs.JobService
- func (b *Backend) NotifyUser(ctx scope.Context, userID proto.UserID, packetType proto.PacketType, ...) error
- func (b *Backend) PMTracker() proto.PMTracker
- func (b *Backend) Peers() []cluster.PeerDesc
- func (b *Backend) Unban(ctx scope.Context, ban proto.Ban) error
- func (b *Backend) Version() string
- type BannedAgent
- type BannedIP
- type BroadcastMessage
- type Capability
- type Email
- type EmailTracker
- func (et *EmailTracker) Get(ctx scope.Context, accountID snowflake.Snowflake, id string) (*emails.EmailRef, error)
- func (et *EmailTracker) List(ctx scope.Context, accountID snowflake.Snowflake, n int, before time.Time) ([]*emails.EmailRef, error)
- func (et *EmailTracker) MarkDelivered(ctx scope.Context, accountID snowflake.Snowflake, id string) error
- func (et *EmailTracker) Send(ctx scope.Context, js jobs.JobService, templater *templates.Templater, ...) (*emails.EmailRef, error)
- type JobItem
- type JobLog
- type JobQueue
- type JobQueueBinding
- func (jq *JobQueueBinding) Add(ctx scope.Context, jobType jobs.JobType, payload interface{}, ...) (snowflake.Snowflake, error)
- func (jq *JobQueueBinding) AddAndClaim(ctx scope.Context, jobType jobs.JobType, payload interface{}, handlerID string, ...) (*jobs.Job, error)
- func (jq *JobQueueBinding) Cancel(ctx scope.Context, jobID snowflake.Snowflake) error
- func (jq *JobQueueBinding) Complete(ctx scope.Context, jobID snowflake.Snowflake, handlerID string, ...) error
- func (jq *JobQueueBinding) Fail(ctx scope.Context, jobID snowflake.Snowflake, handlerID string, ...) error
- func (jq *JobQueueBinding) Log(ctx scope.Context, jobID snowflake.Snowflake, attemptNumber int32) (*jobs.JobLog, error)
- func (jq *JobQueueBinding) Name() string
- func (jq *JobQueueBinding) Stats(ctx scope.Context) (jobs.JobQueueStats, error)
- func (jq *JobQueueBinding) TryClaim(ctx scope.Context, handlerID string) (*jobs.Job, error)
- func (jq *JobQueueBinding) TrySteal(ctx scope.Context, handlerID string) (*jobs.Job, error)
- func (jq *JobQueueBinding) WaitForJob(ctx scope.Context) error
- type JobService
- type Listener
- type ListenerMap
- type ManagedRoomBinding
- func (rb *ManagedRoomBinding) AddManager(ctx scope.Context, kms security.KMS, actor proto.Account, ...) error
- func (rb *ManagedRoomBinding) Ban(ctx scope.Context, ban proto.Ban, until time.Time) error
- func (rb *ManagedRoomBinding) GenerateMessageKey(ctx scope.Context, kms security.KMS) (proto.RoomMessageKey, error)
- func (rb *ManagedRoomBinding) IsValidParent(id snowflake.Snowflake) (bool, error)
- func (rb *ManagedRoomBinding) ManagerCapability(ctx scope.Context, manager proto.Account) (security.Capability, error)
- func (rb *ManagedRoomBinding) ManagerKey(ctx scope.Context) (proto.RoomManagerKey, error)
- func (rb *ManagedRoomBinding) Managers(ctx scope.Context) ([]proto.Account, error)
- func (rb *ManagedRoomBinding) MessageKey(ctx scope.Context) (proto.RoomMessageKey, error)
- func (rb *ManagedRoomBinding) MessageKeyID(ctx scope.Context) (string, bool, error)
- func (rb *ManagedRoomBinding) MinAgentAge() time.Duration
- func (rb *ManagedRoomBinding) RemoveManager(ctx scope.Context, actor proto.Account, actorKey *security.ManagedKey, ...) error
- func (rb *ManagedRoomBinding) Unban(ctx scope.Context, ban proto.Ban) error
- type Message
- type MessageEditLog
- type MessageKey
- type Nick
- type OTP
- type PM
- type PMRoomBinding
- func (pmrb *PMRoomBinding) MessageKeyID(ctx scope.Context) (string, bool, error)
- func (pmrb *PMRoomBinding) ResolveNick(ctx scope.Context, userID proto.UserID) (string, bool, error)
- func (pmrb *PMRoomBinding) Snapshot(ctx scope.Context, session proto.Session, level proto.PrivilegeLevel, ...) (*proto.SnapshotEvent, error)
- type PMTracker
- type PasswordResetRequest
- type PersonalIdentity
- type PersonalIdentityBinding
- type Presence
- type Room
- type RoomBinding
- func (rb *RoomBinding) EditMessage(ctx scope.Context, session proto.Session, edit proto.EditMessageCommand) (proto.EditMessageReply, error)
- func (rb *RoomBinding) GetMessage(ctx scope.Context, id snowflake.Snowflake) (*proto.Message, error)
- func (rb *RoomBinding) ID() string
- func (rb *RoomBinding) IsValidParent(id snowflake.Snowflake) (bool, error)
- func (rb *RoomBinding) Join(ctx scope.Context, session proto.Session) (string, error)
- func (rb *RoomBinding) Latest(ctx scope.Context, n int, before snowflake.Snowflake) ([]proto.Message, error)
- func (rb *RoomBinding) Listing(ctx scope.Context, level proto.PrivilegeLevel, exclude ...proto.Session) (proto.Listing, error)
- func (rb *RoomBinding) MessageKeyID(ctx scope.Context) (string, bool, error)
- func (rb *RoomBinding) Part(ctx scope.Context, session proto.Session) error
- func (rb *RoomBinding) RenameUser(ctx scope.Context, session proto.Session, formerName string) (*proto.NickEvent, error)
- func (rb *RoomBinding) ResolveClientAddress(ctx scope.Context, addr string) (net.IP, error)
- func (rb *RoomBinding) ResolveNick(ctx scope.Context, userID proto.UserID) (string, bool, error)
- func (rb *RoomBinding) Send(ctx scope.Context, session proto.Session, msg proto.Message) (proto.Message, error)
- func (rb *RoomBinding) Snapshot(ctx scope.Context, session proto.Session, level proto.PrivilegeLevel, ...) (*proto.SnapshotEvent, error)
- func (rb *RoomBinding) Title() string
- func (rb *RoomBinding) WaitForPart(sessionID string) error
- type RoomCapability
- type RoomCapabilityBinding
- type RoomManagerCapabilities
- func (rmc *RoomManagerCapabilities) Get(ctx scope.Context, cid string) (security.Capability, error)
- func (rmc *RoomManagerCapabilities) Remove(ctx scope.Context, capabilityID string) error
- func (rmc *RoomManagerCapabilities) Save(ctx scope.Context, account proto.Account, c security.Capability) error
- type RoomManagerCapability
- type RoomManagerCapabilityBinding
- type RoomManagerKeyBinding
- func (rmkb *RoomManagerKeyBinding) KeyPair() security.ManagedKeyPair
- func (rmkb *RoomManagerKeyBinding) Nonce() []byte
- func (rmkb *RoomManagerKeyBinding) SetExecutor(executor gorp.SqlExecutor)
- func (rmkb *RoomManagerKeyBinding) StaffUnlock(kms security.KMS) (*security.ManagedKeyPair, error)
- func (rmkb *RoomManagerKeyBinding) Unlock(managerKey *security.ManagedKey) (*security.ManagedKeyPair, error)
- type RoomMessageCapabilities
- func (rmc *RoomMessageCapabilities) Get(ctx scope.Context, cid string) (security.Capability, error)
- func (rmc *RoomMessageCapabilities) Remove(ctx scope.Context, capabilityID string) error
- func (rmc *RoomMessageCapabilities) Save(ctx scope.Context, account proto.Account, c security.Capability) error
- type RoomMessageKey
- type RoomMessageKeyBinding
- type SessionLog
- type VirtualAddress
Constants ¶
View Source
const OTPKeyType = security.AES128
Variables ¶
View Source
var ErrPsqlConnectionLost = errors.New("postgres connection lost")
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID string Name string Email string Nonce []byte MAC []byte EncryptedSystemKey []byte `db:"encrypted_system_key"` EncryptedUserKey []byte `db:"encrypted_user_key"` EncryptedPrivateKey []byte `db:"encrypted_private_key"` PublicKey []byte `db:"public_key"` StaffCapabilityID sql.NullString `db:"staff_capability_id"` }
func (*Account) Bind ¶
func (a *Account) Bind(b *Backend) *AccountBinding
type AccountBinding ¶
type AccountBinding struct { *Backend *Account StaffCapability *Capability // contains filtered or unexported fields }
func (*AccountBinding) Email ¶
func (ab *AccountBinding) Email() (string, bool)
func (*AccountBinding) ID ¶
func (ab *AccountBinding) ID() snowflake.Snowflake
func (*AccountBinding) IsStaff ¶
func (ab *AccountBinding) IsStaff() bool
func (*AccountBinding) KeyFromPassword ¶
func (ab *AccountBinding) KeyFromPassword(password string) *security.ManagedKey
func (*AccountBinding) KeyPair ¶
func (ab *AccountBinding) KeyPair() security.ManagedKeyPair
func (*AccountBinding) Name ¶
func (ab *AccountBinding) Name() string
func (*AccountBinding) PersonalIdentities ¶
func (ab *AccountBinding) PersonalIdentities() []proto.PersonalIdentity
func (*AccountBinding) SystemKey ¶
func (ab *AccountBinding) SystemKey() security.ManagedKey
func (*AccountBinding) Unlock ¶
func (ab *AccountBinding) Unlock(clientKey *security.ManagedKey) (*security.ManagedKeyPair, error)
func (*AccountBinding) UnlockStaffKMS ¶
func (ab *AccountBinding) UnlockStaffKMS(clientKey *security.ManagedKey) (security.KMS, error)
func (*AccountBinding) UserKey ¶
func (ab *AccountBinding) UserKey() security.ManagedKey
func (*AccountBinding) View ¶
func (ab *AccountBinding) View(roomName string) *proto.AccountView
type AccountManagerBinding ¶
type AccountManagerBinding struct {
*Backend
}
func (*AccountManagerBinding) ChangeClientKey ¶
func (b *AccountManagerBinding) ChangeClientKey( ctx scope.Context, accountID snowflake.Snowflake, oldKey, newKey *security.ManagedKey) error
func (*AccountManagerBinding) ChangeEmail ¶
func (*AccountManagerBinding) ChangeName ¶
func (*AccountManagerBinding) ConfirmPasswordReset ¶
func (*AccountManagerBinding) GenerateOTP ¶
func (*AccountManagerBinding) GetPasswordResetAccount ¶
func (*AccountManagerBinding) GrantStaff ¶
func (b *AccountManagerBinding) GrantStaff( ctx scope.Context, accountID snowflake.Snowflake, kmsCred security.KMSCredential) error
func (*AccountManagerBinding) Register ¶
func (b *AccountManagerBinding) Register( ctx scope.Context, kms security.KMS, namespace, id, password string, agentID string, agentKey *security.ManagedKey) ( proto.Account, *security.ManagedKey, error)
func (*AccountManagerBinding) RequestPasswordReset ¶
func (*AccountManagerBinding) RevokeStaff ¶
func (*AccountManagerBinding) SetUserKey ¶
func (b *AccountManagerBinding) SetUserKey( ctx scope.Context, accountID snowflake.Snowflake, key *security.ManagedKey) error
func (*AccountManagerBinding) ValidateOTP ¶
func (*AccountManagerBinding) VerifyPersonalIdentity ¶
func (b *AccountManagerBinding) VerifyPersonalIdentity(ctx scope.Context, namespace, id string) error
type AccountWithStaffCapability ¶
type AccountWithStaffCapability struct { AccountID string `db:"id"` CapabilityAccountID sql.NullString `db:"account_id"` AccountNonce []byte `db:"nonce"` StaffCapabilityID sql.NullString `db:"staff_capability_id"` StaffCapabilityNonce []byte `db:"staff_capability_nonce"` Account Capability }
func (*AccountWithStaffCapability) Bind ¶
func (awsc *AccountWithStaffCapability) Bind(b *Backend) *AccountBinding
type AgentTrackerBinding ¶
type AgentTrackerBinding struct {
*Backend
}
func (*AgentTrackerBinding) ClearClientKey ¶
func (atb *AgentTrackerBinding) ClearClientKey(ctx scope.Context, agentID string) error
func (*AgentTrackerBinding) SetClientKey ¶
func (atb *AgentTrackerBinding) SetClientKey( ctx scope.Context, agentID string, accessKey *security.ManagedKey, accountID snowflake.Snowflake, clientKey *security.ManagedKey) error
type Backend ¶
func NewBackend ¶
func (*Backend) AccountManager ¶
func (b *Backend) AccountManager() proto.AccountManager
func (*Backend) AgentTracker ¶
func (b *Backend) AgentTracker() proto.AgentTracker
func (*Backend) CreateRoom ¶
func (*Backend) EmailTracker ¶
func (b *Backend) EmailTracker() proto.EmailTracker
func (*Backend) Jobs ¶
func (b *Backend) Jobs() jobs.JobService
func (*Backend) NotifyUser ¶
type BannedAgent ¶
type BroadcastMessage ¶
type Capability ¶
type Capability struct { ID string AccountID string `db:"account_id"` NonceBytes []byte `db:"nonce"` EncryptedPrivateData []byte `db:"encrypted_private_data"` PublicData []byte `db:"public_data"` }
func (*Capability) CapabilityID ¶
func (c *Capability) CapabilityID() string
func (*Capability) EncryptedPayload ¶
func (c *Capability) EncryptedPayload() []byte
func (*Capability) Nonce ¶
func (c *Capability) Nonce() []byte
func (*Capability) PublicPayload ¶
func (c *Capability) PublicPayload() []byte
type Email ¶
type Email struct { ID string AccountID string `db:"account_id"` JobID int64 `db:"job_id"` EmailType string `db:"email_type"` SendTo string `db:"send_to"` SendFrom string `db:"send_from"` Message []byte Created time.Time Delivered gorp.NullTime Failed gorp.NullTime }
func (*Email) FromBackend ¶
type EmailTracker ¶
type EmailTracker struct {
Backend *Backend
}
func (*EmailTracker) MarkDelivered ¶
type JobItem ¶
type JobItem struct { ID int64 Queue string JobType string `db:"job_type"` Data []byte Created time.Time Due time.Time Claimed gorp.NullTime Completed gorp.NullTime MaxWorkDurationSeconds int32 `db:"max_work_duration_seconds"` AttemptsMade int32 `db:"attempts_made"` AttemptsRemaining int32 `db:"attempts_remaining"` }
type JobLog ¶
type JobLog struct { JobID int64 `db:"job_id"` Attempt int32 HandlerID string `db:"handler_id"` Started time.Time Finished gorp.NullTime Stolen gorp.NullTime StolenBy sql.NullString `db:"stolen_by"` Outcome sql.NullString Log []byte }
type JobQueue ¶
type JobQueue struct {
Name string
}
func (*JobQueue) Bind ¶
func (jq *JobQueue) Bind(b *Backend) *JobQueueBinding
type JobQueueBinding ¶
func (*JobQueueBinding) AddAndClaim ¶
func (*JobQueueBinding) Name ¶
func (jq *JobQueueBinding) Name() string
func (*JobQueueBinding) Stats ¶
func (jq *JobQueueBinding) Stats(ctx scope.Context) (jobs.JobQueueStats, error)
func (*JobQueueBinding) WaitForJob ¶
func (jq *JobQueueBinding) WaitForJob(ctx scope.Context) error
type JobService ¶
type JobService struct {
*Backend
}
type ListenerMap ¶
type ManagedRoomBinding ¶
type ManagedRoomBinding struct { RoomBinding *Room }
func (*ManagedRoomBinding) AddManager ¶
func (*ManagedRoomBinding) GenerateMessageKey ¶
func (rb *ManagedRoomBinding) GenerateMessageKey(ctx scope.Context, kms security.KMS) ( proto.RoomMessageKey, error)
func (*ManagedRoomBinding) IsValidParent ¶
func (rb *ManagedRoomBinding) IsValidParent(id snowflake.Snowflake) (bool, error)
func (*ManagedRoomBinding) ManagerCapability ¶
func (rb *ManagedRoomBinding) ManagerCapability(ctx scope.Context, manager proto.Account) ( security.Capability, error)
func (*ManagedRoomBinding) ManagerKey ¶
func (rb *ManagedRoomBinding) ManagerKey(ctx scope.Context) (proto.RoomManagerKey, error)
func (*ManagedRoomBinding) MessageKey ¶
func (rb *ManagedRoomBinding) MessageKey(ctx scope.Context) (proto.RoomMessageKey, error)
func (*ManagedRoomBinding) MessageKeyID ¶
func (*ManagedRoomBinding) MinAgentAge ¶
func (rb *ManagedRoomBinding) MinAgentAge() time.Duration
func (*ManagedRoomBinding) RemoveManager ¶
func (rb *ManagedRoomBinding) RemoveManager( ctx scope.Context, actor proto.Account, actorKey *security.ManagedKey, formerManager proto.Account) error
type Message ¶
type Message struct { Room string ID string PreviousEditID sql.NullString `db:"previous_edit_id"` Parent string Posted time.Time Edited gorp.NullTime Deleted gorp.NullTime SessionID string `db:"session_id"` SenderID string `db:"sender_id"` SenderName string `db:"sender_name"` SenderClientAddress string `db:"sender_client_address"` SenderIsManager bool `db:"sender_is_manager"` SenderIsStaff bool `db:"sender_is_staff"` ServerID string `db:"server_id"` ServerEra string `db:"server_era"` Content string EncryptionKeyID sql.NullString `db:"encryption_key_id"` }
func NewMessage ¶
func (*Message) ToTransmission ¶
type MessageEditLog ¶
type MessageEditLog struct { EditID string `db:"edit_id"` Room string MessageID string `db:"message_id"` EditorID sql.NullString `db:"editor_id"` PreviousEditID sql.NullString `db:"previous_edit_id"` PreviousContent string `db:"previous_content"` PreviousParent sql.NullString `db:"previous_parent"` }
type MessageKey ¶
type PM ¶
type PM struct { ID string Initiator string InitiatorNick string `db:"initiator_nick"` Receiver string ReceiverNick string `db:"receiver_nick"` ReceiverMAC []byte `db:"receiver_mac"` IV []byte EncryptedSystemKey []byte `db:"encrypted_system_key"` EncryptedInitiatorKey []byte `db:"encrypted_initiator_key"` EncryptedReceiverKey []byte `db:"encrypted_receiver_key"` }
type PMRoomBinding ¶
type PMRoomBinding struct { RoomBinding // contains filtered or unexported fields }
func (*PMRoomBinding) MessageKeyID ¶
func (*PMRoomBinding) ResolveNick ¶
func (*PMRoomBinding) Snapshot ¶
func (pmrb *PMRoomBinding) Snapshot( ctx scope.Context, session proto.Session, level proto.PrivilegeLevel, numMessages int) (*proto.SnapshotEvent, error)
type PasswordResetRequest ¶
type PersonalIdentity ¶
type PersonalIdentityBinding ¶
type PersonalIdentityBinding struct {
// contains filtered or unexported fields
}
func (*PersonalIdentityBinding) ID ¶
func (pib *PersonalIdentityBinding) ID() string
func (*PersonalIdentityBinding) Namespace ¶
func (pib *PersonalIdentityBinding) Namespace() string
func (*PersonalIdentityBinding) Verified ¶
func (pib *PersonalIdentityBinding) Verified() bool
type Presence ¶
type Presence struct { Room string Topic string ServerID string `db:"server_id"` ServerEra string `db:"server_era"` SessionID string `db:"session_id"` Updated time.Time KeyID string `db:"key_id"` Fact []byte }
func (*Presence) SessionView ¶
func (p *Presence) SessionView(level proto.PrivilegeLevel) (proto.SessionView, error)
type Room ¶
type Room struct { Name string FoundedBy string `db:"founded_by"` RetentionDays int `db:"retention_days"` Nonce []byte `db:"pk_nonce"` MAC []byte `db:"pk_mac"` IV []byte `db:"pk_iv"` EncryptedManagementKey []byte `db:"encrypted_management_key"` EncryptedPrivateKey []byte `db:"encrypted_private_key"` PublicKey []byte `db:"public_key"` MinAgentAge int64 `db:"min_agent_age"` }
func (*Room) Bind ¶
func (r *Room) Bind(b *Backend) *ManagedRoomBinding
type RoomBinding ¶
type RoomBinding struct { *Backend RoomName string RoomTitle string // contains filtered or unexported fields }
func (*RoomBinding) EditMessage ¶
func (rb *RoomBinding) EditMessage( ctx scope.Context, session proto.Session, edit proto.EditMessageCommand) ( proto.EditMessageReply, error)
func (*RoomBinding) GetMessage ¶
func (*RoomBinding) ID ¶
func (rb *RoomBinding) ID() string
func (*RoomBinding) IsValidParent ¶
func (rb *RoomBinding) IsValidParent(id snowflake.Snowflake) (bool, error)
func (*RoomBinding) Listing ¶
func (rb *RoomBinding) Listing(ctx scope.Context, level proto.PrivilegeLevel, exclude ...proto.Session) (proto.Listing, error)
func (*RoomBinding) MessageKeyID ¶
func (*RoomBinding) RenameUser ¶
func (*RoomBinding) ResolveClientAddress ¶
func (*RoomBinding) ResolveNick ¶
func (*RoomBinding) Snapshot ¶
func (rb *RoomBinding) Snapshot( ctx scope.Context, session proto.Session, level proto.PrivilegeLevel, numMessages int) (*proto.SnapshotEvent, error)
func (*RoomBinding) Title ¶
func (rb *RoomBinding) Title() string
func (*RoomBinding) WaitForPart ¶
func (rb *RoomBinding) WaitForPart(sessionID string) error
type RoomCapability ¶
type RoomCapabilityBinding ¶
type RoomCapabilityBinding struct { AccountID string `db:"account_id"` Capability RoomCapability }
func (*RoomCapabilityBinding) CapabilityID ¶
func (rcb *RoomCapabilityBinding) CapabilityID() string
type RoomManagerCapabilities ¶
type RoomManagerCapabilities struct { Room *Room Executor gorp.SqlExecutor }
func (*RoomManagerCapabilities) Get ¶
func (rmc *RoomManagerCapabilities) Get(ctx scope.Context, cid string) (security.Capability, error)
func (*RoomManagerCapabilities) Remove ¶
func (rmc *RoomManagerCapabilities) Remove(ctx scope.Context, capabilityID string) error
func (*RoomManagerCapabilities) Save ¶
func (rmc *RoomManagerCapabilities) Save( ctx scope.Context, account proto.Account, c security.Capability) error
type RoomManagerCapability ¶
type RoomManagerCapability RoomCapability
type RoomManagerCapabilityBinding ¶
type RoomManagerCapabilityBinding struct { AccountID string `db:"account_id"` Capability RoomManagerCapability }
func (*RoomManagerCapabilityBinding) CapabilityID ¶
func (rmcb *RoomManagerCapabilityBinding) CapabilityID() string
type RoomManagerKeyBinding ¶
type RoomManagerKeyBinding struct { *Room *RoomManagerCapabilities *proto.GrantManager }
func NewRoomManagerKeyBinding ¶
func NewRoomManagerKeyBinding(rb *ManagedRoomBinding) *RoomManagerKeyBinding
func (*RoomManagerKeyBinding) KeyPair ¶
func (rmkb *RoomManagerKeyBinding) KeyPair() security.ManagedKeyPair
func (*RoomManagerKeyBinding) Nonce ¶
func (rmkb *RoomManagerKeyBinding) Nonce() []byte
func (*RoomManagerKeyBinding) SetExecutor ¶
func (rmkb *RoomManagerKeyBinding) SetExecutor(executor gorp.SqlExecutor)
func (*RoomManagerKeyBinding) StaffUnlock ¶
func (rmkb *RoomManagerKeyBinding) StaffUnlock(kms security.KMS) (*security.ManagedKeyPair, error)
func (*RoomManagerKeyBinding) Unlock ¶
func (rmkb *RoomManagerKeyBinding) Unlock( managerKey *security.ManagedKey) (*security.ManagedKeyPair, error)
type RoomMessageCapabilities ¶
type RoomMessageCapabilities struct { Room *Room Executor gorp.SqlExecutor }
func (*RoomMessageCapabilities) Get ¶
func (rmc *RoomMessageCapabilities) Get(ctx scope.Context, cid string) (security.Capability, error)
func (*RoomMessageCapabilities) Remove ¶
func (rmc *RoomMessageCapabilities) Remove(ctx scope.Context, capabilityID string) error
func (*RoomMessageCapabilities) Save ¶
func (rmc *RoomMessageCapabilities) Save( ctx scope.Context, account proto.Account, c security.Capability) error
type RoomMessageKey ¶
type RoomMessageKeyBinding ¶
type RoomMessageKeyBinding struct { *proto.GrantManager MessageKey RoomMessageKey }
func NewRoomMessageKeyBinding ¶
func NewRoomMessageKeyBinding( rb *ManagedRoomBinding, keyID snowflake.Snowflake, msgKey *security.ManagedKey, nonce []byte) *RoomMessageKeyBinding
func (*RoomMessageKeyBinding) KeyID ¶
func (rmkb *RoomMessageKeyBinding) KeyID() string
func (*RoomMessageKeyBinding) ManagedKey ¶
func (rmkb *RoomMessageKeyBinding) ManagedKey() security.ManagedKey
func (*RoomMessageKeyBinding) Nonce ¶
func (rmkb *RoomMessageKeyBinding) Nonce() []byte
func (*RoomMessageKeyBinding) Timestamp ¶
func (rmkb *RoomMessageKeyBinding) Timestamp() time.Time
type SessionLog ¶
Click to show internal directories.
Click to hide internal directories.