ginger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package ginger supports integration with the Driebit Ginger platform

Via a PostHook function during the Bulking Index process data that is ingested can also be stored in ginger. It currently synchronizes indexing and disabling all records for a dataset.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRoutes

func GetRoutes() chi.Router

Types

type AuthKey

type AuthKey struct {
	Key string
	sync.Mutex
}

type Hit

type Hit struct {
	Source `json:"_source"`
}

type PostHook

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

func NewPostHook

func NewPostHook(orgID, endpoint, apiKey string, customWait int, excludedDataSets ...string) *PostHook

func (*PostHook) DropDataset

func (ph *PostHook) DropDataset(dataset string, revision int) (resp *http.Response, err error)

func (*PostHook) Name added in v0.2.0

func (ph *PostHook) Name() string

func (*PostHook) OrgID

func (ph *PostHook) OrgID() string

func (*PostHook) Publish

func (ph *PostHook) Publish(items ...*domain.PostHookItem) error

func (*PostHook) Run added in v0.2.1

func (ph *PostHook) Run(datasetID string) error

func (*PostHook) Valid

func (ph *PostHook) Valid(datasetID string) bool

type PostHookCounter

type PostHookCounter struct {
	ToIndex           int  `json:"toIndex"`
	ToDelete          int  `json:"toDelete"`
	InError           int  `json:"inError"`
	LifeTimeQueued    int  `json:"lifeTimeQueued"`
	LifeTimeProcessed int  `json:"lifeTimeProcessed"`
	IsActive          bool `json:"isActive"`
}

type PostHookGauge

type PostHookGauge struct {
	Created        time.Time                   `json:"created"`
	QueueSize      int                         `json:"queueSize"`
	ActiveDatasets int                         `json:"activeDatasets"`
	Counters       map[string]*PostHookCounter `json:"counters"`
	sync.Mutex
}

func (*PostHookGauge) Done

func (phg *PostHookGauge) Done(ph *PostHookJob) error

func (*PostHookGauge) Error

func (phg *PostHookGauge) Error(ph *PostHookJob) error

func (*PostHookGauge) Queue

func (phg *PostHookGauge) Queue(ph *PostHookJob) error

func (*PostHookGauge) SetActive

func (phg *PostHookGauge) SetActive(counter *PostHookCounter)

type PostHookJob

type PostHookJob struct {
	Graph string
	// contains filtered or unexported fields
}

PostHookJob holds the info for building a crea

func NewPostHookJob

func NewPostHookJob(item *domain.PostHookItem) (*PostHookJob, error)

NewPostHookJob creates a new PostHookJob and populates the rdf2go Graph

type Source

type Source struct {
	Revision int `json:"revision"`
	System   `json:"system"`
}

type System

type System struct {
	HubID       string `json:"slug"`
	Spec        string `json:"spec"`
	Subject     string `json:"source_uri"`
	SourceGraph string `json:"source_graph"`
}

Jump to

Keyboard shortcuts

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