catalogimportapi

package
v1.148.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package catalogimportapi is the admin REST surface for the import of a deployment's DataHub into the platform catalog (#1923): start an import from the DataHub the configuration names (#2124) or one an administrator names, and read what each run did.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(mux *http.ServeMux, wrap func(http.Handler) http.Handler, cfg Config)

Register mounts the routes, each behind wrap, the admin API's authentication.

Types

type Config

type Config struct {
	// Runner runs imports. nil mounts nothing.
	Runner Runner
	// Author resolves the acting admin.
	Author func(*http.Request) string
}

Config carries the runner and the parent-owned helpers.

type RunList

type RunList struct {
	Imports []catalogimport.Run `json:"imports"`
	// Configured is the address of the DataHub the configuration names in
	// toolkits.datahub, which the platform imports from after its first
	// catalog scan; empty when it names none.
	Configured string `json:"configured,omitempty" example:"https://datahub.example.com:8080"`
}

RunList is the latest runs, newest first, and the DataHub the configuration names.

type Runner

type Runner interface {
	Start(ctx context.Context, address, token, by string) (catalogimport.Run, error)
	StartConfigured(ctx context.Context, by string) (catalogimport.Run, error)
	Runs(ctx context.Context, limit int) ([]catalogimport.Run, error)
	Configured() string
}

Runner starts imports and lists their runs. *catalogimport.Runner satisfies it.

type StartRequest

type StartRequest struct {
	// URL is DataHub's GMS address, such as https://datahub.example.com:8080.
	URL string `json:"url,omitempty" example:"https://datahub.example.com:8080"`
	// Token is a DataHub personal access token. It is used for this run and
	// not kept.
	Token string `json:"token,omitempty"`
}

StartRequest names the DataHub an import reads. An empty request, or no body, reads the DataHub the configuration names.

Jump to

Keyboard shortcuts

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