client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InstanceNameHeaderKey is the key for instance name http header
	InstanceNameHeaderKey = "AresDB-InstanceName"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerClient

type ControllerClient interface {
	client.SchemaFetcher

	GetSchemaHash(namespace string) (string, error)
	GetAllSchema(namespace string) ([]metaCom.Table, error)
	GetNamespaces() ([]string, error)
	GetAssignmentHash(jobNamespace, instance string) (string, error)
	GetAssignment(jobNamespace, instance string) (*models.IngestionAssignment, error)
}

ControllerClient defines methods to communicate with ares-controller

type ControllerHTTPClient

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

ControllerHTTPClient implements ControllerClient over http

func NewControllerHTTPClient

func NewControllerHTTPClient(address string, timeoutSec time.Duration, headers http.Header) *ControllerHTTPClient

NewControllerHTTPClient returns new ControllerHTTPClient

func (*ControllerHTTPClient) ExtendEnumCases

func (c *ControllerHTTPClient) ExtendEnumCases(tableName, columnName string, enumCases []string) (enumIDs []int, err error)

ExtendEnumCases extends enum cases to given table column

func (*ControllerHTTPClient) FetchAllEnums

func (c *ControllerHTTPClient) FetchAllEnums(tableName string, columnName string) (enumDictReponse []string, err error)

FetchAllEnums fetches all enums for given table and column

func (*ControllerHTTPClient) FetchAllSchemas

func (c *ControllerHTTPClient) FetchAllSchemas() (tables []*metaCom.Table, err error)

FetchAllSchemas fetches all schemas

func (*ControllerHTTPClient) FetchSchema

func (c *ControllerHTTPClient) FetchSchema(tableName string) (table *metaCom.Table, err error)

FetchSchema fetch one schema for given table

func (*ControllerHTTPClient) GetAllSchema

func (c *ControllerHTTPClient) GetAllSchema(namespace string) (tables []metaCom.Table, err error)

func (*ControllerHTTPClient) GetAssignment

func (c *ControllerHTTPClient) GetAssignment(jobNamespace, instance string) (assignment *models.IngestionAssignment, err error)

GetAssignment gets the job assignment of the ares-subscriber

func (*ControllerHTTPClient) GetAssignmentHash

func (c *ControllerHTTPClient) GetAssignmentHash(jobNamespace, instance string) (hash string, err error)

GetAssignmentHash get hash code of assignment

func (*ControllerHTTPClient) GetNamespaces

func (c *ControllerHTTPClient) GetNamespaces() (namespaces []string, err error)

func (*ControllerHTTPClient) GetSchemaHash

func (c *ControllerHTTPClient) GetSchemaHash(namespace string) (hash string, err error)

func (*ControllerHTTPClient) SetNamespace

func (c *ControllerHTTPClient) SetNamespace(namespace string)

SetNamespace sets the namespace which the ControllerHTTPClient connects to

Directories

Path Synopsis
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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