types

package
v0.0.0-...-c323ddb Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MD5AuthSalt [4]byte = [4]byte{'1', '2', '3', '4'}

Functions

func SchemaNameFixer

func SchemaNameFixer(name string) string

Types

type AuthProvider

type AuthProvider interface {
	CheckAccess(accessInfo TableAccessInfo, username string) bool
	CheckAuth(username, password string) bool
	IsSuperUser(username string) bool
}

type QueryResult

type QueryResult struct {
	pgproto3.RowDescription
	DataRows   []pgproto3.DataRow
	CommandTag []byte
}

type TableAccessInfo

type TableAccessInfo struct {
	TableInfo
	AccessMode TableAccessMode
}

type TableAccessMode

type TableAccessMode int64
const (
	Select TableAccessMode = iota
	Delete
	Insert
	Update
	System
	Invalid
)

func TableAccessModeFromString

func TableAccessModeFromString(s string) (index TableAccessMode, err error)

func (TableAccessMode) ToString

func (tam TableAccessMode) ToString() string

type TableInfo

type TableInfo struct {
	Name   string
	Schema string
}

type YAMLFileAuthProvider

type YAMLFileAuthProvider struct {
	// contains filtered or unexported fields
}

func (*YAMLFileAuthProvider) CheckAccess

func (p *YAMLFileAuthProvider) CheckAccess(accessInfo TableAccessInfo, username string) bool

func (*YAMLFileAuthProvider) CheckAuth

func (p *YAMLFileAuthProvider) CheckAuth(username, password string) bool

func (*YAMLFileAuthProvider) IsSuperUser

func (p *YAMLFileAuthProvider) IsSuperUser(username string) bool

func (*YAMLFileAuthProvider) SetConfig

func (p *YAMLFileAuthProvider) SetConfig(configFilePath string) error

type YAMLFileAuthProviderConfig

type YAMLFileAuthProviderConfig map[string]YAMLFileAuthProviderConfigUser

type YAMLFileAuthProviderConfigUser

type YAMLFileAuthProviderConfigUser struct {
	Superuser bool   `yaml:"superuser"`
	Password  string `yaml:"password"`
	Tables    []struct {
		Name        string   `yaml:"name"`
		Schema      string   `yaml:"schema"`
		AccessModes []string `yaml:"access_modes"`
	} `yaml:"tables"`
}

Jump to

Keyboard shortcuts

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