connect

package module
v0.0.0-...-dc35274 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: BSD-2-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EnvSdkUsername = "TT_CLI_EE_USERNAME"
	EnvSdkPassword = "TT_CLI_EE_PASSWORD"
)
View Source
const (
	TCPNetwork  = "tcp"
	UnixNetwork = "unix"
)
View Source
const EnvEtcdCredentialsHelp = "The command supports the following Etcd environment variables:\n" +
	"* " + EtcdUsernameEnv + " - specifies a Etcd username\n" +
	"* " + EtcdPasswordEnv + " - specifies a Etcd password"
View Source
const EnvTarantoolCredentialsHelp = "The command supports the following Tarantool environment variables:\n" +
	"* " + TarantoolUsernameEnv + " - specifies a Tarantool username\n" +
	"* " + TarantoolPasswordEnv + " - specifies a Tarantool password"

nolint: lll

View Source
const EtcdPasswordEnv = "TT_CLI_ETCD_PASSWORD"

EtcdPasswordEnv is an environment variable with a password for etcd.

View Source
const EtcdUsernameEnv = "TT_CLI_ETCD_USERNAME"

EtcdUsernameEnv is an environment variable with a username for etcd.

View Source
const TarantoolPasswordEnv = "TT_CLI_PASSWORD"

TarantoolPasswordEnv is an environment variable with a password for Tarantool.

View Source
const TarantoolUsernameEnv = "TT_CLI_USERNAME"

TarantoolUsernameEnv is an environment variable with a username for Tarantool.

Variables

This section is empty.

Functions

func IsBaseURI

func IsBaseURI(str string) bool

IsBaseURI returns true if a string is a valid URI.

func IsCredentialsURI

func IsCredentialsURI(str string) bool

IsCredentialsURI returns true if a string is a valid credentials URI.

func MakeURLHelp

func MakeURLHelp(data map[string]any) string

nolint: lll MakeURLHelp returns a part of command help message related to URL arguments. The function uses a template to generate the message. Accepts following placeholders in the `data` map:

`header` - string: a header for the help message;
`footer` - string: a final message of the help;
`service` - string: name of the service to connect with URL;
`prefix` - string: a base path used by service application;
`tag` - string: description how `#fragment` part used by application;
`param_<name>` - string: description for an extra URL param with <name> added to help;
`env_<name>_auth` - string: service info. It will expanded to:
	* <name>_USERNAME - specifies a <info> username;
	* <name>_PASSWORD - specifies a <info> password.
`env_<name>` - string: description for an extra environment variable with <name>:
	* <name> - <description>.

func ParseBaseURI

func ParseBaseURI(uri string) (string, string)

ParseBaseURI parses an URI and returns: (network, address)

func ParseCredentialsURI

func ParseCredentialsURI(str string) (string, string, string)

ParseCredentialsURI parses a URI with credentials and returns: (URI without credentials, user, password)

Types

type UriOpts

type UriOpts struct {
	// Endpoint is a an endpoint to connect: [scheme://]host[:port].
	Endpoint string
	// Host is a an address to connect: host[:port].
	Host string
	// Prefix is a configuration prefix.
	Prefix string
	// Tag value of #fragment URL part.
	Tag string
	// Username is a user name for authorization
	Username string
	// Password is a password for authorization
	Password string
	// KeyFile is a path to a private SSL key file.
	KeyFile string
	// CertFile is a path to an SSL certificate file.
	CertFile string
	// CaPath is a path to a trusted certificate authorities (CA) directory.
	CaPath string
	// CaFile is a path to a trusted certificate authorities (CA) file.
	CaFile string
	// Ciphers is a colon-separated (:) list of SSL cipher suites the
	// connection can use.
	Ciphers string
	// SkipHostVerify controls whether a client verifies the server's
	// host name. This is dangerous option so by default it is false.
	SkipHostVerify bool
	// SkipHostVerify controls whether a client verifies the server's
	// certificate chain. This is dangerous option so by default it is false.
	SkipPeerVerify bool
	// Timeout is a timeout for actions.
	Timeout time.Duration
	// Params keeps extra URL parameters.
	Params map[string]string
}

UriOpts is a universal list of connect options retrieved from an URI.

func CreateUriOpts

func CreateUriOpts(url string) (UriOpts, error)

CreateUriOpts parse URL string and creates appropriated UriOpts.

type UserCredentials

type UserCredentials struct {
	Username string
	Password string
}

func GetCreds

func GetCreds(cliOpts *config.CliOpts) (UserCredentials, error)

getCreds gets credentials for tarantool-ee download.

Jump to

Keyboard shortcuts

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