cockroach: Index | Files

package hba

import ""

Package hba implements an hba.conf parser.


Package Files

conf.go hba.go

type Conf Uses

type Conf struct {
    Entries []Entry

Conf is a parsed configuration.

func Parse Uses

func Parse(input string) (*Conf, error)

func (Conf) String Uses

func (c Conf) String() string

type Entry Uses

type Entry struct {
    Type     string
    Database []String
    User     []String
    // Address is either a String or *net.IPNet.
    Address interface{}
    Method  string
    Options [][2]string

Entry is a single line of a configuration.

func (Entry) GetOption Uses

func (h Entry) GetOption(name string) string

GetOption returns the value of option name if there is exactly one occurrence of name in the options list, otherwise the empty string.

func (Entry) GetOptions Uses

func (h Entry) GetOptions(name string) []string

GetOptions returns all values of option name.

func (Entry) String Uses

func (h Entry) String() string

type String Uses

type String struct {
    Value  string
    Quoted bool

String is a possibly quoted string.

func (String) IsSpecial Uses

func (s String) IsSpecial(v string) bool

IsSpecial returns whether s is the non-quoted string v.

func (String) String Uses

func (s String) String() string

Package hba imports 5 packages (graph) and is imported by 2 packages. Updated 2019-07-16. Refresh now. Tools for package owners.