opts

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package opts contains a DB's configuration and URI parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any

func Any(ss ...string) string

Any returns the first non-zero string of those given. Useful for options with defaults or multiple names.

Types

type Opts

type Opts struct {
	Proto string
	User  string
	Pass  string
	Name  string
	Port  string
	Path  string
	Frag  string
	Extra map[string]string
}

Opts contains the options for opening and using a DB.

func FromURI

func FromURI(u *url.URL) (Opts, error)

FromURI converts the given *url.URL into an Opts.

func Parse

func Parse(uri string) (Opts, error)

Parse translates the given URI into an Opts.

func (Opts) String

func (o Opts) String() string

String implements fmt.Stringer.

func (Opts) URI

func (o Opts) URI() *url.URL

URI converts the Opts to a *url.URL.

Jump to

Keyboard shortcuts

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