datasourcecache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ESClientProvider

type ESClientProvider interface {
	CreateDocument(index, documentID string, body []byte) ([]byte, error)
	Get(index string, query map[string]interface{}, result interface{}) error
	UpdateDocument(index string, id string, body interface{}) ([]byte, error)
}

ESClientProvider used in connecting to ES server

type Hits

type Hits struct {
	Hits []NestedHits `json:"hits"`
}

Hits result

type NestedHits

type NestedHits struct {
	ID     string `json:"_id"`
	Source Status `json:"_source"`
}

NestedHits is the actual hit data

type Status

type Status struct {
	ProjectSlug         string      `json:"project_slug"`
	Datasource          string      `json:"datasource"`
	Endpoint            string      `json:"endpoint"`
	UpdatedAt           time.Time   `json:"updated_at"`
	CreatedAt           time.Time   `json:"created_at"`
	ErrorMessage        string      `json:"error_message"`
	Status              int         `json:"status"`
	LastSuccessfulEvent interface{} `json:"last_successful_event"`
}

Status ...

type StatusProvider

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

StatusProvider ...

func NewStatusProvider

func NewStatusProvider(esClient ESClientProvider, environment string) (*StatusProvider, error)

NewStatusProvider ...

func (*StatusProvider) Pull

func (s *StatusProvider) Pull(projectSlug string, datasource string, endpoint string) (*Status, error)

Pull ...

func (*StatusProvider) Store

func (s *StatusProvider) Store(status Status) error

Store ...

type TopHits

type TopHits struct {
	Hits Hits `json:"hits"`
}

TopHits result

Jump to

Keyboard shortcuts

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