rest

package
v0.0.0-...-9585d8b Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	ValidateSession(ctx context.Context, key, ip, agent string) (userId string, err error)
}

type ErrMessageDeleted

type ErrMessageDeleted interface {
	Error() string
	ImplementsMessageDeletedError()
}

type ErrMessageNotModified

type ErrMessageNotModified interface {
	Error() string
	ImplementsMessageNotModifiedError()
}

type ErrTimestampIsNotMatch

type ErrTimestampIsNotMatch interface {
	Error() string
	ImplementsTimestampIsNotMatchError()
}

type FileStats

type FileStats interface {
	SendUsage(ctx context.Context, fileId string, inUse bool) error
}

type Service

type Service struct {
	Shutdown chan struct{}
	// contains filtered or unexported fields
}

func (*Service) Start

func (s *Service) Start(auth Authenticator, storage Storage, fileStats FileStats)

func (*Service) Stop

func (s *Service) Stop(ctx context.Context) (err error)

type Storage

type Storage interface {
	CreateNewPersonalMessageV1(ctx context.Context, sender string, data *models.NewPersonalMessageV1) (id int64, timestamp int64, err error)
	MessageUpdatesV1(ctx context.Context, userId string, after int64, limit int) (*models.MessageUpdatesV1, error)
	PersonalMessageV1(ctx context.Context, userId string, messageId int64) (*models.PersonalMessageV1, error)
	EditMessageText(ctx context.Context, id, timestamp int64, text string) (newTimestamp int64, err error)
	SetMessageReadState(ctx context.Context, id, timestamp int64, read bool) (newTimestamp int64, err error)
	DeleteMessageData(ctx context.Context, id, timestamp int64) (newTimestamp int64, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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