pod

package module
v0.0.0-...-e796fa2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 6 Imported by: 0

README

pod

Package pod provides a pod implementation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name       string `yaml:"name"`
	Version    string `yaml:"version"`
	Datasource struct {
		Name    string   `yaml:"name"`
		Type    string   `yaml:"type"`
		Brokers []string `yaml:"brokers"`
		Topic   string   `yaml:"topic"`
	} `yaml:"datasource"`
	Preprocessor struct {
		Filename string `yaml:"filename"`
		Type     string `yaml:"type"`
	} `yaml:"preprocessor"`
	Model struct {
		Name     string `yaml:"name"`
		Filename string `yaml:"filename"`
	} `yaml:"model"`
	Endpoint struct {
		Name   string            `yaml:"name"`
		Type   string            `yaml:"type"`
		URL    string            `yaml:"url"`
		Fields map[string]string `yaml:"fields"`
	} `yaml:"endpoint"`
}

Yaml file is unmarshalled into Config before creating a pod

type Datasource

type Datasource interface {
	Fetch() ([]byte, error)
}

type Endpoint

type Endpoint struct {
	Name   string            `yaml:"name"`
	Type   string            `yaml:"type"`
	URL    string            `yaml:"url"`
	Fields map[string]string `yaml:"fields"`
}

type KafkaReader

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

KafkaReader is a wrapper around kafka.Reader that extends a Fetch() method to implement the Datasource interface

func (KafkaReader) Fetch

func (k KafkaReader) Fetch() ([]byte, error)

type Model

type Model struct {
	Name     string `yaml:"name"`
	Filename string `yaml:"filename"`
}

type Pod

type Pod struct {
	Name         string
	Version      string
	Datasource   Datasource
	Preprocessor Preprocessor
	Model        Model
	Endpoint     Endpoint
}

func New

func New(filename string) (*Pod, error)

New initializes a Pod using the given config filename

type Preprocessor

type Preprocessor struct {
	Filename string `yaml:"filename"`
	Type     string `yaml:"type"`
}

Jump to

Keyboard shortcuts

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