Documentation ¶
Index ¶
- Constants
- type ConnChangeResult
- type Handler
- func (h *Handler) AuthClient(product, productPassword, clientKey, clientPassword string) error
- func (h *Handler) ConnChange(ctx context.Context, product, productPassword string) (*rpc.Subscription, error)
- func (h *Handler) GetEndpoint(product, productPassword, clientKey string) (*data.Endpoint, error)
- func (h *Handler) SetProductConfig(product, productPassword string, config map[string]string) error
- func (h *Handler) StartSession(product, productPassword, clientKey, ip string, port uint16) (*data.Offering, error)
- func (h *Handler) UpdateSession(product, productPassword, clientKey string, units uint64, stopSession bool) error
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 ¶
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 ¶
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.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.