sgi

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

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

Go to latest
Published: Oct 30, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

README

Socrates for Go

Install

Stable
go get github.com/jyro-io/sgi@0.0.2

Usage


Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToMongo

func ConnectToMongo(host string) mongo.Client

ConnectToMongo connect to Mongo in a robust manner

Types

type Datasource

type Datasource struct {
	Type                 string   `json:"type"`
	Host                 string   `json:"host"`
	Port                 string   `json:"port"`
	TimeoutMs            int      `json:"timeout_ms"`
	TimestampField       string   `json:"timestamp_field"`
	TimestampFormat      string   `json:"timestamp_format"`
	TimestampFormatJulia string   `json:"timestamp_format_julia"`
	TopicPrefix          string   `json:"topic_prefix"`
	Topics               []string `json:"topics"`
	Metadata             struct {
		Window struct {
			Limit struct {
				Upper int `json:"upper"`
				Lower int `json:"lower"`
			} `json:"limit"`
			ScaleFactor float64 `json:"scale_factor"`
		} `json:"window"`
		Join interface{} `json:"join"`
		Etl  []struct {
			Operation  string      `json:"operation"`
			Name       string      `json:"name"`
			Parameters interface{} `json:"parameters,omitempty"`
			PullFields bool        `json:"pull_fields,omitempty"`
		} `json:"etl"`
	} `json:"metadata"`
	Replication struct {
		Type     string `json:"type"`
		Host     string `json:"host"`
		Username string `json:"username"`
		Password string `json:"password"`
		Database string `json:"database"`
	} `json:"replication"`
}

type Response

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

func GetDefinition

func GetDefinition(s Socrates, api string, module string, name string) (Response, error)

type Socrates

type Socrates struct {
	LogLevel  int
	Host      string
	Protocol  string
	VerifySSL bool
	Username  string
	Password  string
	Headers   struct {
		ContentType   string
		Authorization string
		Token         string
	}
	Client *http.Client
}

Socrates object for communicating with the API

func NewClient

func NewClient(
	logLevel int,
	host string,
	protocol string,
	username string,
	password string) Socrates

NewClient construct an authenticated Socrates client object

Jump to

Keyboard shortcuts

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