cmd

package
v0.0.23-r1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Version is the version number of this program, should be populated while building.

Functions

func AddCertPermission added in v0.0.16

func AddCertPermission(KeyFile, CertFile, TokenFile string, in *os.File) error

AddCertPermission adds a new ACL rule into `TokenFile` for clients using `CertFile` and `KeyFile`.

func Execute

func Execute()

Execute is the cmd entry.

func GenerateCA added in v0.0.16

func GenerateCA(CertName string, OutputFolder string, Length int) error

GenerateCA generates a CA with `CertName` as its common name, and stores `ca.key` and `ca.cert` into `OutputFolder`.

func GenerateCertificate added in v0.0.16

func GenerateCertificate(CertName string, DNSName string, CAFolder string, OutputFolder string, Length int) error

GenerateCertificate generates a certificate signed by CA stored in `CAFolder`.

func GenerateConfigToFolder added in v0.0.16

func GenerateConfigToFolder(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, OutputFolder string, ConfigBaseFolderOverride string, Length int) error

GenerateConfigToFolder generates configs into the Output folder.

func GenerateConfigZip added in v0.0.16

func GenerateConfigZip(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, ConfigFile string, ConfigBaseFolderOverride string, Length int) error

GenerateConfigZip generates a zip file including a whole set of configuration required to connect to yukino-net.

func GenerateWebhookHashToken added in v0.0.16

func GenerateWebhookHashToken(Token string) string

GenerateWebhookHashToken creates a salted token as a webhook server side token.

func InvokeEndpointService added in v0.0.16

func InvokeEndpointService(ctx context.Context, ConfigFile []string, Channel string, Command []string, PrivateKey string, timeout time.Duration) (string, error)

InvokeEndpointService invokes an endpoint service serving on `Channel`. `PrivateKey` can be empty if authenticaiton is not set on the server side.

func MountLocal added in v0.0.16

func MountLocal(ConfigFile []string, Channel, LocalAddr string) error

MountLocal mountes a channel to a local address.

func MountLocalListener added in v0.0.16

func MountLocalListener(ConfigFile []string, Channel string, LocalListener net.Listener) error

MountLocalListener mounts a channel to a listener.

func MountRemote added in v0.0.16

func MountRemote(ConfigFile []string, Channel, RemoteAddr string) error

MountRemote mountes a remote address as a `channel` on yukino-net.

func PrepareConfigFiles added in v0.0.16

func PrepareConfigFiles(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, ConfigBaseFolderOverride string, Length int) (map[string][]byte, string, error)

PrepareConfigFiles generates a config set in map[filename] = filedata format.

func StartEndpointService added in v0.0.16

func StartEndpointService(ctx context.Context, ConfigFile []string, Channel string, ACL []string, BaseCommand string) error

StartEndpointService starts an endpoint service listening on `Channel`.

func StartEndpointWebhookProxy added in v0.0.16

func StartEndpointWebhookProxy(ctx context.Context, ConfigFile []string, LocalAddr, HashToken string) error

StartEndpointWebhookProxy creates a web service that can proxy an endpoint invoke.

func StartRouter added in v0.0.16

func StartRouter(ConfigFile []string) error

StartRouter creates a router service.

Types

This section is empty.

Jump to

Keyboard shortcuts

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