datasourcecache

package
v1.5.32 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 5 Imported by: 0

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