sess

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CRC16("github.com/privatix/dappctrl/sess") = 0x12DD
	ErrAccessDenied errors.Error = 0x12DD<<8 + iota
	ErrChannelNotFound
	ErrBadClientPassword
	ErrInternal
	ErrNonActiveChannel
	ErrSessionNotFound
	ErrEndpointNotFound
	ErrBadProductConfig
)

Errors.

View Source
const (
	ConnStart = "start"
	ConnStop  = "stop"
)

Adapter connection statuses.

View Source
const ProductExternalIP = "externalIP"

ProductExternalIP is a configuration key for external IP address.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnChangeResult

type ConnChangeResult struct {
	Channel string `json:"channel,omitempty"`
	Status  string `json:"command,omitempty"`
}

ConnChangeResult is an ConnChange notification result.

type Handler

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

Handler is a session RPC handler.

func NewHandler

func NewHandler(logger log.Logger, db *reform.DB,
	countryConf *country.Config, queue job.Queue) *Handler

NewHandler creates a new session handler.

func (*Handler) AuthClient

func (h *Handler) AuthClient(product, productPassword,
	clientKey, clientPassword string) error

AuthClient verifies password for a given client key.

func (*Handler) ConnChange

func (h *Handler) ConnChange(ctx context.Context,
	product, productPassword string) (*rpc.Subscription, error)

ConnChange subscribes to changes for adapter connection changes.

func (*Handler) GetEndpoint

func (h *Handler) GetEndpoint(
	product, productPassword, clientKey string) (*data.Endpoint, error)

GetEndpoint returns an endpoint for a given client key.

func (*Handler) SetProductConfig

func (h *Handler) SetProductConfig(
	product, productPassword string, config map[string]string) error

SetProductConfig sets product configuration.

func (*Handler) StartSession

func (h *Handler) StartSession(product, productPassword,
	clientKey, ip string, port uint16) (*data.Offering, error)

StartSession creates a new client session.

func (*Handler) UpdateSession

func (h *Handler) UpdateSession(product, productPassword, clientKey string,
	units uint64, stopSession bool) error

UpdateSession updates and optionally stops the current client session.

Jump to

Keyboard shortcuts

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