handlers

package
v0.0.85 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const MaxIds = 20000

Variables

This section is empty.

Functions

func DeleteAssets added in v0.0.32

func DeleteAssets(registry sources.Registry, graphUpdater *knowledge.GraphUpdater, sem *semaphore.Weighted) http.HandlerFunc

DeleteAssets delete multiple assets from the graph of the data source

func DeleteRelations added in v0.0.32

func DeleteRelations(registry sources.Registry, graphUpdater *knowledge.GraphUpdater, sem *semaphore.Weighted) http.HandlerFunc

DeleteRelations remove multiple relations from the graph of the data source

func GetGraphRead added in v0.0.50

func GetGraphRead(registry sources.Registry, graphDB knowledge.GraphDB) http.HandlerFunc

GetGraphRead GET the entire graph generated by the data source

func IsTokenValid

func IsTokenValid(registry sources.Registry, r *http.Request) (bool, string, error)

IsTokenValid is the token valid

func PostQuery added in v0.0.31

func PostQuery(database knowledge.GraphDB, queryHistorizer history.Historizer, cacheTTL time.Duration) http.HandlerFunc

PostQuery post endpoint to query the graph

func PostQueryAssetsSources added in v0.0.54

func PostQueryAssetsSources(database knowledge.GraphDB) http.HandlerFunc

PostQueryAssetsSources post endpoint to retrieve the sources of a given set of assets

func PostQueryRelationsSources added in v0.0.54

func PostQueryRelationsSources(database knowledge.GraphDB) http.HandlerFunc

PostQueryAssetsSources post endpoint to retrieve the sources of a given set of assets

func PutAssets added in v0.0.32

func PutAssets(registry sources.Registry, graphUpdater *knowledge.GraphUpdater, sem *semaphore.Weighted) http.HandlerFunc

PutAssets upsert several assets into the graph of the data source

func PutRelations added in v0.0.32

func PutRelations(registry sources.Registry, graphUpdater *knowledge.GraphUpdater, sem *semaphore.Weighted) http.HandlerFunc

PutRelations upsert multiple relations into the graph of the data source

func PutSchema

func PutSchema(registry sources.Registry, graphUpdater *knowledge.GraphUpdater, sem *semaphore.Weighted) http.HandlerFunc

PutSchema upsert an asset into the graph of the data source

func ReplyWithBadRequest added in v0.0.40

func ReplyWithBadRequest(w http.ResponseWriter, err error)

ReplyWithBadRequest send response with bad request.

func ReplyWithInternalError

func ReplyWithInternalError(w http.ResponseWriter, err error)

ReplyWithInternalError send response with internal error.

func ReplyWithSourceGraph

func ReplyWithSourceGraph(w http.ResponseWriter, sg *schema.SchemaGraph)

ReplyWithSourceGraph sends a reply containing the schema graph

func ReplyWithTooManyRequests

func ReplyWithTooManyRequests(w http.ResponseWriter)

ReplyWithTooManyRequests send unauthorized response.

func ReplyWithUnauthorized

func ReplyWithUnauthorized(w http.ResponseWriter)

ReplyWithUnauthorized send unauthorized response.

Types

type AssetWithIDAndSources added in v0.0.62

type AssetWithIDAndSources struct {
	Sources []string `json:"sources,omitempty"`
	knowledge.AssetWithID
}

type ColumnType added in v0.0.62

type ColumnType struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type QueryRequestBody added in v0.0.62

type QueryRequestBody struct {
	Query          string `json:"q"`
	IncludeSources bool   `json:"include_sources"`
}

type QueryResponseBody added in v0.0.62

type QueryResponseBody struct {
	Items           [][]interface{} `json:"items"`
	Columns         []ColumnType    `json:"columns"`
	ExecutionTimeMs time.Duration   `json:"execution_time_ms"`
}

type RelationWithIDAndSources added in v0.0.62

type RelationWithIDAndSources struct {
	Sources []string `json:"sources,omitempty"`
	knowledge.RelationWithID
}

Jump to

Keyboard shortcuts

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