dbanon

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogger added in v0.5.0

func GetLogger() *logrus.Logger

GetLogger returns the logger instance. This instance is the entry point for all logging

func SetLogger added in v0.5.0

func SetLogger(l *logrus.Logger)

SetLogger sets the logger instance This is useful in testing as the logger can be overridden with a test logger

Types

type Column added in v0.6.0

type Column struct {
	Name      string
	Type      string
	MaxLength int
}

func NewColumn added in v0.6.0

func NewColumn(n string, t string, i int) *Column

type Config

type Config struct {
	Tables []struct {
		Name    string            `yaml:"name"`
		Columns map[string]string `yaml:"columns"`
	}
	Eav []struct {
		Name       string            `yaml:"name"`
		Attributes map[string]string `yaml:"attributes"`
	}
}

func NewConfig

func NewConfig(requested string) (*Config, error)

func (Config) ProcessColumn

func (c Config) ProcessColumn(t string, col string) (bool, string)

func (Config) ProcessEav

func (c Config) ProcessEav(t string, attributeId string) (bool, string)

func (Config) ProcessTable

func (c Config) ProcessTable(t string) string

func (Config) String

func (c Config) String() ([]byte, error)

type Eav

type Eav struct {
	Config *Config
	// contains filtered or unexported fields
}

func NewEav

func NewEav(c *Config) *Eav

type LineProcessor

type LineProcessor struct {
	Mode     string
	Config   *Config
	Provider ProviderInterface
	Eav      *Eav
}

func NewLineProcessor

func NewLineProcessor(m string, c *Config, p ProviderInterface, e *Eav) *LineProcessor

func (LineProcessor) ProcessLine

func (p LineProcessor) ProcessLine(s string) string

type Provider

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

func NewProvider

func NewProvider() *Provider

func (Provider) Get

func (p Provider) Get(s string) string

type ProviderInterface

type ProviderInterface interface {
	Get(s string) string
}

Jump to

Keyboard shortcuts

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