msg

package
v0.0.0-...-55bacb3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogDir            = "logDir"
	TapInterface      = "tapInterface"
	VpnManagementPort = "vpnManagementPort"
	UpScript          = "upScript"
	DownScript        = "downScript"
)

Specific adapter options.

View Source
const (
	// CRC16("github.com/privatix/dapp-openvpn/adapter/msg") = 0x6D7F
	ErrContextIsDone errors.Error = 0x6D7F<<8 + iota
	ErrCreateAccessFile
	ErrCreateConfig
	ErrCreateDir
	ErrDecodeParams
	ErrFindCert
	ErrGenConfig
	ErrParseConfigTemplate
	ErrReadCert
	ErrReadConfig
	ErrServiceEndpointAddr
)

Errors.

View Source
const (

	// PushedFile the name of a file that indicates that
	// the configuration is already loaded on the server.
	PushedFile = "configPushed"
)

Variables

This section is empty.

Functions

func Done

func Done(dir string) error

Done makes configPushed file.

func IsDone

func IsDone(dir string) bool

IsDone checks if the vpn configuration is loaded to server.

func MakeFiles

func MakeFiles(logger log.Logger, dir, serviceEndpointAddress, username,
	password string, params []byte, options map[string]interface{}) error

MakeFiles creates configuration files for a product.

Types

type Config

type Config struct {
	CaCertPath       string
	ConfigPath       string
	ExportConfigKeys []string
	TimeOut          int64
}

Config is configuration to Pusher.

func NewConfig

func NewConfig() *Config

NewConfig creates a default configuration.

type Pusher

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

Pusher updates the product configuration.

func NewPusher

func NewPusher(conf *Config, logger log.Logger,
	setProductConfig SetProductConfigFunc) *Pusher

NewPusher creates a new Pusher object. Argument conf to parsing vpn configuration. Arguments srv, user, pass to send configuration to session service.

func (*Pusher) PushConfiguration

func (p *Pusher) PushConfiguration(ctx context.Context,
	params map[string]string) error

PushConfiguration sends a vpn configuration to session server.

func (*Pusher) VpnParams

func (p *Pusher) VpnParams() (map[string]string, error)

VpnParams parses the OpenVpn configuration file.

type SetProductConfigFunc

type SetProductConfigFunc func(config map[string]string) error

SetProductConfigFunc sets controller's product configuration.

Jump to

Keyboard shortcuts

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