ports

package
v0.0.0-...-79c48be Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BCryptPasswordHasher

type BCryptPasswordHasher struct{}

func (*BCryptPasswordHasher) Hash

func (h *BCryptPasswordHasher) Hash(password string) ([]byte, error)

type CommandSessionHttpCreate

type CommandSessionHttpCreate struct {
	UsedId    int64
	UserEmail string
	IpAddr    net.IP
	UserAgent string
	Result    struct {
		Session domain.Session
		Token   domain.SessionHttpToken
	}
}

func (*CommandSessionHttpCreate) IsValid

func (c *CommandSessionHttpCreate) IsValid() bool

func (*CommandSessionHttpCreate) Reset

func (c *CommandSessionHttpCreate) Reset()

type CommandUserCreate

type CommandUserCreate struct {
	Email      string
	Surname    string
	GivenNames string
	Password   string
	Result     domain.User
}

func (*CommandUserCreate) IsValid

func (c *CommandUserCreate) IsValid() bool

func (*CommandUserCreate) Reset

func (c *CommandUserCreate) Reset()

type DriverSession

type DriverSession interface {
	// CreateHttp create a new http session for the given user.
	// IpAddr and UserAgent must be derived from the http request.
	// Any error occured must be considered internal.
	CreateHttp(create *CommandSessionHttpCreate) error
	// DecodeHttpTokenTo decodes and validates the http session token.
	// Errors:
	//	domain.ErrValue - token can't be decoded or verified;
	//	domain.ErrExpired - token has expired;
	//	domain.ErrSessionTerminated - token had been revoked;
	//	other - internal.
	DecodeHttpTokenTo(dst *domain.SessionHttpToken, src []byte) error
}

type DriverTextNQ

type DriverTextNQ interface {
	// Submit the text message for delivery. Returns whether the message
	// will be processed shortly or not (depends on a queue load).
	// Only reports render errors.
	Submit(renderFn DriverTextNSRenderFn, deliverFn DriverTextNSDeliverFn) (shortly bool, errRender error)
}

type DriverTextNSDeliverFn

type DriverTextNSDeliverFn = func(recipient string, data []byte) error

type DriverTextNSRenderFn

type DriverTextNSRenderFn = func(dst []byte) error

type DriverUser

type DriverUser interface {
	// Create creates a new user from the given data.
	// Errors:
	//	domain.ErrExists - user exists;
	//	other - internal.
	Create(*CommandUserCreate) error
}

type PasswordHasher

type PasswordHasher interface {
	Hash(string) ([]byte, error)
}

type RepositorySession

type RepositorySession interface {
	// Create creates the session and replaces its Id, CreatedAt and ExpiresAt.
	// Any error occurred must be interpreted as internal.
	Create(*domain.Session) error
	// IsTerminated returns whether the session had been terminated or not.
	// The given buffer will be used to convert sessionId to bytes.
	// Any error occurred must be interpreted as internal.
	IsTerminated(sessionId int64, buf []byte) (bool, error)
}

type RepositoryUser

type RepositoryUser interface {
	// Create creates the user and replaces its Id and CreatedAt.
	// Errors:
	//	domain.ErrExists - the user already exists;
	//	other - internal error.
	Create(*domain.User) error
}

Jump to

Keyboard shortcuts

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