brands

package
v0.0.0-...-21bb69c Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheControlHeader string

CacheControlHeader is the value to set on http header

Functions

This section is empty.

Types

type Brand

type Brand struct {
	Thing
	DescriptionXML string  `json:"descriptionXML,omitempty"`
	Strapline      string  `json:"strapline,omitempty"`
	ImageURL       string  `json:"_imageUrl,omitempty"` // NB Temp hack
	Parent         *Thing  `json:"parentBrand,omitempty"`
	Children       []Thing `json:"childBrands,omitempty"`
}

Brand represent a brand owned by an organisation, current only used is relation to FT brands

type BrandsHandler

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

func NewHandler

func NewHandler(client httpClient, conceptsURL string) BrandsHandler

func (*BrandsHandler) Checker

func (h *BrandsHandler) Checker() (string, error)

func (*BrandsHandler) GTG

func (h *BrandsHandler) GTG() gtg.Status

GoodToGo returns a 503 if the healthcheck fails - suitable for use from varnish to check availability of a node

func (*BrandsHandler) GetBrand

func (h *BrandsHandler) GetBrand(w http.ResponseWriter, r *http.Request)

GetBrand is the public API

func (*BrandsHandler) HealthCheck

func (h *BrandsHandler) HealthCheck() fthealth.Check

func (*BrandsHandler) MethodNotAllowedHandler

func (h *BrandsHandler) MethodNotAllowedHandler(w http.ResponseWriter, r *http.Request)

MethodNotAllowedHandler does stuff

func (*BrandsHandler) RegisterHandlers

func (h *BrandsHandler) RegisterHandlers(router *mux.Router)

type Concept

type Concept struct {
	ID           string `json:"id,omitempty"`
	ApiURL       string `json:"apiUrl,omitempty"`
	PrefLabel    string `json:"prefLabel,omitempty"`
	Type         string `json:"type,omitempty"`
	IsDeprecated bool   `json:"isDeprecated,omitempty"`
}

type ConceptApiResponse

type ConceptApiResponse struct {
	Concept
	ImageURL       string           `json:"imageUrl,omitempty"`
	DescriptionXML string           `json:"descriptionXML,omitempty"`
	Strapline      string           `json:"strapline,omitempty"`
	Broader        []RelatedConcept `json:"broaderConcepts,omitempty"`
	Narrower       []RelatedConcept `json:"narrowerConcepts,omitempty"`
}

type NeoBrand

type NeoBrand struct {
	NeoThing
	DescriptionXML string     `json:"descriptionXML,omitempty"`
	Strapline      string     `json:"strapline,omitempty"`
	ImageURL       string     `json:"imageUrl,omitempty"` // NB Temp hack
	Parent         NeoThing   `json:"parent,omitempty"`
	Children       []NeoThing `json:"children,omitempty"`
	Authority      string     `json:"authority,omitempty"`
}

NeoBrand is the same as Brand, but it receives an extra field and multiple parents.

type NeoThing

type NeoThing struct {
	ID           string   `json:"id,omitempty"`
	Types        []string `json:"types,omitempty"`
	PrefLabel    string   `json:"prefLabel,omitempty"`
	IsDeprecated bool     `json:"isDeprecated,omitempty"`
}

type RelatedConcept

type RelatedConcept struct {
	Concept Concept `json:concept,omitempty`
}

type Thing

type Thing struct {
	ID           string   `json:"id,omitempty"`
	APIURL       string   `json:"apiUrl,omitempty"`
	Types        []string `json:"types,omitempty"`
	DirectType   string   `json:"directType,omitempty"`
	PrefLabel    string   `json:"prefLabel,omitempty"`
	IsDeprecated bool     `json:"isDeprecated,omitempty"`
}

Thing is the base entity, all Public APIs should have these properties

Jump to

Keyboard shortcuts

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