services

package
v0.0.0-...-f750f1c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdmin

func NewAdmin(base *BaseService, destroy *bool) rpc.AdminService

func NewBlob

func NewBlob(base *BaseService) rpc.BlobService

func NewInfo

func NewInfo(base *BaseService, pubKeyPem string) rpc.InfoService

func NewMessage

func NewMessage(base *BaseService) rpc.MessageService

func NewNotification

func NewNotification(base *BaseService) rpc.NotificationService

func NewUser

func NewUser(base *BaseService) rpc.UserService

Types

type BaseService

type BaseService struct {
	// contains filtered or unexported fields
}

func NewBase

func NewBase(repos repo.Repos, tokenParser token.Parser, tokenGenerator token.Generator, externalAddress, userHubAddress string, s3Storage *common.S3Storage, notificationSender NotificationSender) *BaseService

type ContextKey

type ContextKey string
const (
	ContextUserKey ContextKey = "user"
)

type MessageCleaner

type MessageCleaner struct {
	// contains filtered or unexported fields
}

func NewMessageCleaner

func NewMessageCleaner(externalAddress, apiEndpoint string, tokenGenerator token.Generator) *MessageCleaner

func (*MessageCleaner) DeleteExpiredMessages

func (mc *MessageCleaner) DeleteExpiredMessages(messageRepo repo.MessageRepo)

type Notification

type Notification struct {
	UserIDs     []string               `json:"users"`
	Text        string                 `json:"text"`
	MessageType string                 `json:"message_type"`
	Data        map[string]interface{} `json:"data"`
}

type NotificationSender

type NotificationSender interface {
	Start()
	SendNotification(notification Notification)
}

func NewNotificationSender

func NewNotificationSender(notificationRepo common.NotificationRepo, externalAddress, userHubEndpoint string,
	tokenGenerator token.Generator) NotificationSender

type User

type User struct {
	ID           string
	Name         string
	FullName     string
	IsHubAdmin   bool
	IsBlocked    bool
	BlockedUsers []string
	OwnedGroups  []string
}

func (User) DisplayName

func (u User) DisplayName() string

func (User) IsBlockedUser

func (u User) IsBlockedUser(userID string) bool

func (User) IsOwnedGroup

func (u User) IsOwnedGroup(groupID string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL