cockroach: Index | Files

package roleoption

import ""


Package Files

option_string.go role_option.go


var ByName = map[string]Option{
    "LOGIN":        LOGIN,
    "NOLOGIN":      NOLOGIN,

ByName is a map of string -> kind value.

type List Uses

type List []RoleOption

List is a list of role options.

func (List) CheckRoleOptionConflicts Uses

func (rol List) CheckRoleOptionConflicts() error

CheckRoleOptionConflicts returns an error if two or more options conflict with each other.

func (List) Contains Uses

func (rol List) Contains(p Option) bool

Contains returns true if List contains option, false otherwise.

func (List) GetPassword Uses

func (rol List) GetPassword() (isNull bool, password string, err error)

GetPassword returns the value of the password or whether the password was set to NULL. Returns error if the string was invalid or if no password option is found.

func (List) GetSQLStmts Uses

func (rol List) GetSQLStmts(op string) (map[string]func() (bool, string, error), error)

GetSQLStmts returns a map of SQL stmts to apply each role option. Maps stmts to values (value of the role option).

func (List) ToBitField Uses

func (rol List) ToBitField() (uint32, error)

ToBitField returns the bitfield representation of a list of role options.

type Option Uses

type Option uint32

Option defines a role option. This is output by the parser

const (

KindList of role options.

func ToOption Uses

func ToOption(str string) (Option, error)

ToOption takes a string and returns the corresponding Option.

func (Option) Mask Uses

func (o Option) Mask() uint32

Mask returns the bitmask for a given role option.

func (Option) String Uses

func (i Option) String() string

type RoleOption Uses

type RoleOption struct {
    HasValue bool
    // Need to resolve value in Exec for the case of placeholders.
    Value func() (bool, string, error)

RoleOption represents an Option with a value.

Package roleoption imports 6 packages (graph) and is imported by 2 packages. Updated 2020-08-11. Refresh now. Tools for package owners.