dbanon

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogger

func GetLogger() *logrus.Logger

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

func SetLogger

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

type Column struct {
	Name      string
	Type      string
	MaxLength int
}

func NewColumn

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{}

func NewProvider

func NewProvider() *Provider

func (Provider) Get

func (p Provider) Get(fakeType string, currentValue *string) string

type ProviderInterface

type ProviderInterface interface {
	Get(fakeType string, currentValue *string) string
}

Jump to

Keyboard shortcuts

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