Documentation ¶
Index ¶
- Constants
- func NewAuth(base *BaseService, sessionUserKey, sessionUserPasswordHashKey string, ...) rpc.AuthService
- func NewBlob(base *BaseService) rpc.BlobService
- func NewGroup(base *BaseService) rpc.GroupService
- func NewInfo(base *BaseService, pubKeyPem string) rpc.InfoService
- func NewInvite(base *BaseService) rpc.InviteService
- func NewMessageHub(base *BaseService, admins []string) rpc.MessageHubService
- func NewMessageHubInternal(base *BaseService) rpc.MessageHubInternalService
- func NewNotification(base *BaseService) rpc.NotificationService
- func NewToken(base *BaseService, tokenGenerator token.Generator, tokenDuration time.Duration) rpc.TokenService
- func NewUser(base *BaseService, passwordHash PasswordHash) rpc.UserService
- type BaseService
- type BaseServiceOptions
- type ContextKey
- type Notification
- type NotificationSender
- type PasswordHash
- type Session
- type SessionSaveOptions
- type TokenParsers
Constants ¶
View Source
const (
SessionDefaultMaxAge = time.Hour * 24 * 365 * 10
)
Variables ¶
This section is empty.
Functions ¶
func NewAuth ¶
func NewAuth(base *BaseService, sessionUserKey, sessionUserPasswordHashKey string, passwordHash PasswordHash, testMode bool, adminList []string, adminFriendship string) rpc.AuthService
func NewBlob ¶
func NewBlob(base *BaseService) rpc.BlobService
func NewGroup ¶
func NewGroup(base *BaseService) rpc.GroupService
func NewInfo ¶
func NewInfo(base *BaseService, pubKeyPem string) rpc.InfoService
func NewInvite ¶
func NewInvite(base *BaseService) rpc.InviteService
func NewMessageHub ¶
func NewMessageHub(base *BaseService, admins []string) rpc.MessageHubService
func NewMessageHubInternal ¶
func NewMessageHubInternal(base *BaseService) rpc.MessageHubInternalService
func NewNotification ¶
func NewNotification(base *BaseService) rpc.NotificationService
func NewToken ¶
func NewToken(base *BaseService, tokenGenerator token.Generator, tokenDuration time.Duration) rpc.TokenService
func NewUser ¶
func NewUser(base *BaseService, passwordHash PasswordHash) rpc.UserService
Types ¶
type BaseService ¶
type BaseService struct {
// contains filtered or unexported fields
}
func NewBase ¶
func NewBase(repos repo.Repos, options BaseServiceOptions) *BaseService
func (*BaseService) GetUserAttachments ¶
func (s *BaseService) GetUserAttachments(ctx context.Context, userID string) common.MailAttachmentList
type BaseServiceOptions ¶
type BaseServiceOptions struct { UserCache caches.Users S3Storage *common.S3Storage TokenGenerator token.Generator TokenParsers *TokenParsers MailSender *common.MailSender Cfg config.Config NotificationSender NotificationSender RootEmailTemplate *template.Template }
type ContextKey ¶
type ContextKey string
const ( ContextUserKey ContextKey = "user" ContextIsAdminKey ContextKey = "isAdmin" ContextSession ContextKey = "session" ContextHubKey ContextKey = "hub" )
type Notification ¶
type NotificationSender ¶
type NotificationSender interface { Start() SendNotification(userIDs []string, text, messageType string, data map[string]interface{}) SendExternalNotifications(notifications []Notification) SetGetUserAttachments(getUserAttachments func(ctx context.Context, userID string) common.MailAttachmentList) }
func NewNotificationSender ¶
func NewNotificationSender(repos repo.Repos, userCache caches.Users, firebaseClient *fcm.Client, mailSender *common.MailSender, rootEmailTemplate *template.Template) NotificationSender
type PasswordHash ¶
type Session ¶
type Session interface { SetValue(key, value interface{}) Clear() Save(options SessionSaveOptions) error }
type SessionSaveOptions ¶
type TokenParsers ¶
type TokenParsers struct {
// contains filtered or unexported fields
}
func NewTokenParsers ¶
func NewTokenParsers(primary token.Parser) *TokenParsers
func (*TokenParsers) Primary ¶
func (tp *TokenParsers) Primary() token.Parser
Click to show internal directories.
Click to hide internal directories.