nde

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID            string `json:"@id,omitempty"`
	Type          string `json:"@type,omitempty"`
	AlternateName string `json:"alternateName,omitempty"`
	Name          string `json:"name,omitempty"`
	SameAs        string `json:"sameAs,omitempty"`
}

type Catalog

type Catalog struct {
	Context     string     `json:"@context,omitempty"`
	ID          string     `json:"@id,omitempty"`
	Type        string     `json:"@type,omitempty"`
	Name        string     `json:"name,omitempty"`
	Description string     `json:"description,omitempty"`
	Publisher   Agent      `json:"publisher,omitempty"`
	Dataset     []*Dataset `json:"dataset,omitempty"`
}

type Dataset

type Dataset struct {
	Context               string         `json:"@context,omitempty"`
	Type                  string         `json:"@type,omitempty"`
	ID                    string         `json:"@id,omitempty"`
	Name                  string         `json:"name,omitempty"`
	Description           string         `json:"description,omitempty"`
	License               string         `json:"license,omitempty"`
	DateCreated           string         `json:"dateCreated,omitempty"`
	DateModified          string         `json:"dateModified,omitempty"`
	DatePublished         string         `json:"datePublished,omitempty"`
	Keywords              []string       `json:"keywords,omitempty"`
	IncludedInDataCatalog string         `json:"includedInDataCatalog,omitempty"`
	InLanguage            []string       `json:"inLanguage,omitempty"`
	MainEntityOfPage      string         `json:"mainEntityOfPage,omitempty"`
	Publisher             Agent          `json:"publisher,omitempty"`
	Creator               Agent          `json:"creator,omitempty"`
	Distribution          []Distribution `json:"distribution,omitempty"`
}
type DatasetLink struct {
	ID   string `json:"@id,omitempty"`
	Type string `json:"@type,omitempty"`
}

type Distribution

type Distribution struct {
	Type           string `json:"@type,omitempty"`
	ContentSize    string `json:"contentSize,omitempty"`
	ContentURL     string `json:"contentUrl,omitempty"`
	DateModified   string `json:"dateModified,omitempty"`
	DatePublished  string `json:"datePublished,omitempty"`
	EncodingFormat string `json:"encodingFormat,omitempty"`
	Name           string `json:"name,omitempty"`
}

type DistributionCfg

type DistributionCfg struct {
	DatasetType string `json:"datasetType"`
	MimeType    string `json:"mimeType"`
	DownloadFmt string `json:"downloadFmt"`
}

type Option

type Option func(*Service) error

func SetConfig

func SetConfig(cfg *RegisterConfig) Option

type RegisterConfig

type RegisterConfig struct {
	RDFBaseURL       string
	Description      string
	Name             string
	DefaultLicense   string
	DefaultLanguages []string
	Publisher        struct {
		Name    string
		AltName string
		URL     string
	}
	DataPath      string // for ead support for now. Replace with dataset service later
	DatasetFmt    string
	Distributions []DistributionCfg
}

func (*RegisterConfig) GetAgent

func (r *RegisterConfig) GetAgent() Agent

func (*RegisterConfig) GetDistributions

func (r *RegisterConfig) GetDistributions(spec, datasetType string) []Distribution

type Service

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

func NewService

func NewService(options ...Option) (*Service, error)

func (*Service) AddDatasets

func (s *Service) AddDatasets(orgID string, catalog *Catalog) error

func (*Service) HandleCatalog

func (s *Service) HandleCatalog(w http.ResponseWriter, r *http.Request)

func (*Service) HandleDataset

func (s *Service) HandleDataset(w http.ResponseWriter, r *http.Request)

func (*Service) Routes

func (s *Service) Routes(router chi.Router)

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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