core

package
v0.0.0-...-a4e98f0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidIDFormat error = errors.New("client ID not in the correct format")
View Source
var ErrInvalidSignature error = errors.New("client signature not valid")

Functions

func New

func New(ds DigitalSigner, dbClient DBClient, logger *slog.Logger) *chatService

Types

type DBClient

type DBClient interface {
	PublishMessage(room string, sortKey float64, message any) (int64, error)
	ReadMessages(ctx context.Context, room string) (<-chan string, <-chan error)
}

type DigitalSigner

type DigitalSigner interface {
	Sign(message string) (string, error)
	Verify(signature, message string) (bool, error)
}

Jump to

Keyboard shortcuts

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