config

package
v0.0.0-...-adf94fa Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeString = "string"
	TypeInt    = "int"
	TypeFloat  = "float"
	TypeBool   = "bool"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Rules
}

func NewConfigFromEnv

func NewConfigFromEnv(ctx context.Context, key string) (*Config, error)

NewConfigFromEnv creates a new config from env

func NewConfigFromURL

func NewConfigFromURL(ctx context.Context, fs afs.Service, URL string) (*Config, error)

type Destination

type Destination struct {
	URL           string
	TableRoot     string
	TextPrefix    string
	IntPrefix     string
	FloatPrefix   string
	URIKeyName    string
	BooleanPrefix string
	Codec         string
}

func (*Destination) Init

func (d *Destination) Init()

func (*Destination) Validate

func (d *Destination) Validate() error

type Field

type Field struct {
	Name  string
	Type  string
	Index int
}

type Rule

type Rule struct {
	Disabled       bool
	SourceURL      string
	TimeField      string
	BatchField     string
	SequenceField  string
	PartitionField string
	IndexingFields []Field

	AllowQuotedNumbers bool
	Dest               Destination
	When               matcher.Basic
	RecordsField       string
	ValueField         string
	PreSorted          bool
	// contains filtered or unexported fields
}

func LoadRule

func LoadRule(data []byte, ext string) (*Rule, error)

func (*Rule) Fields

func (r *Rule) Fields() map[string]*Field

func (*Rule) HasMatch

func (r *Rule) HasMatch(URL string) bool

HasMatch returns true if URL matches prefix or suffix

func (*Rule) Init

func (r *Rule) Init()

func (*Rule) Validate

func (r *Rule) Validate() error

type Rules

type Rules struct {
	gcp.Config
	BaseURL          string
	CheckFrequencyMs int
	Indexes          []*Rule
	*resource.Tracker

	PreSorted *bool
	// contains filtered or unexported fields
}

func (*Rules) Init

func (r *Rules) Init()

func (*Rules) Match

func (r *Rules) Match(URL string) []*Rule

func (*Rules) ProcessorConfig

func (r *Rules) ProcessorConfig(rule *Rule) processor.Config

func (*Rules) ReloadIfNeeded

func (r *Rules) ReloadIfNeeded(ctx context.Context, fs afs.Service) error

Jump to

Keyboard shortcuts

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