config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	Op     Op     `json:"op"`
	Target string `json:"target"`
	Tbl    string `json:"tbl"`
	Allow  bool   `json:"allow"`
}

type Config

type Config struct {
	Targets []Target `json:"targets"`
	Users   []User   `json:"users"`
}

func (Config) Validate

func (c Config) Validate() error

type Connection

type Connection struct {
	Host        string `json:"host"`
	Port        int    `json:"port"`
	User        string `json:"user"`
	Password    string `json:"password"`
	DB          string `json:"db"`
	UseSSL      bool   `json:"use_ssl"`
	MaxPoolSize int    `json:"max_pool_size"`
}

type Op

type Op string
const (
	OpSelect Op = "select"
	OpInsert Op = "insert"
	OpUpdate Op = "update"
	OpDelete Op = "delete"
)

type Target

type Target struct {
	ID         string        `json:"id"`
	Type       string        `json:"type"`
	Connection Connection    `json:"connection"`
	Tables     []TargetTable `json:"tables"`
}

func (*Target) HasField

func (t *Target) HasField(tbl, field string) bool

type TargetTable

type TargetTable struct {
	Table     string   `json:"table"`
	Fields    []string `json:"fields"`
	Sensitive []string `json:"sensitive"`
}

type User

type User struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Acls     []ACL  `json:"acls"`
}

Jump to

Keyboard shortcuts

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