task

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReleaseDataType = "release"
)

Variables

This section is empty.

Functions

func AddTopicWithParents added in v0.4.0

func AddTopicWithParents(slug, parentSlug string, topicsMap map[string]Topic, uniqueTopics map[string]struct{})

AddTopicWithParents adds a topic and its parents to the uniqueTopics map if they don't already exist. It recursively adds parent topics until it reaches the root topic.

func LoadTopicsMap added in v0.4.0

func LoadTopicsMap(ctx context.Context, serviceAuthToken string, topicClient topicCli.Clienter) (map[string]Topic, error)

LoadTopicsMap is a function to load the topic map in publishing (private) mode. This function talks to the dp-topic-api via its private endpoints to retrieve the root topic and its subtopic ids The data returned by the dp-topic-api is of type *models.PrivateSubtopics which is then mapped to match the *Topic struct

func MapResourceToSearchDataImport added in v0.4.0

func MapResourceToSearchDataImport(resourceItem upstreamModels.Resource) extractorModels.SearchDataImport

MapResourceToSearchDataImport Performs default mapping of a Resource item to a SearchDataImport struct.

Types

type DatasetEditionMetadata

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

DatasetEditionMetadata holds the necessary information for a dataset edition, plus isBasedOn

type Document

type Document struct {
	ID   string
	URI  string
	Body []byte
}

type Result

type Result struct {
	Success bool
	Err     error
}

Result holds final results of a task run

type Task

type Task struct {
	Config *config.Config
}

Task defines a runnable task

func (*Task) Run

func (t *Task) Run(ctx context.Context) *Result

Run runs the task

type Topic added in v0.4.0

type Topic struct {
	ID              string
	Slug            string
	LocaliseKeyName string
	ParentID        string
	ParentSlug      string
}

type Tracker

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

Tracker is a struct that implements synchronised incremental counters

func (*Tracker) Get

func (t *Tracker) Get() map[string]int

Get returns a map of all the current counters

func (*Tracker) Inc

func (t *Tracker) Inc(name string)

Inc increments a named counter

Jump to

Keyboard shortcuts

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