model

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MIT Imports: 0 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CookiesPolicy

type CookiesPolicy struct {
	Essential bool `json:"essential"`
	Usage     bool `json:"usage"`
}

CookiesPolicy contains data for the users cookie policy

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type FeatureFlags

type FeatureFlags struct {
	HideCookieBanner       bool   `json:"hide_cookie_banner"`
	ONSDesignSystemVersion string `json:"ons_design_system_version"`
}

FeatureFlags contains toggles for certain features on the website

type Metadata

type Metadata struct {
	Title       string   `json:"title"`
	Description string   `json:"description"`
	ServiceName string   `json:"serviceName"`
	Keywords    []string `json:"keywords"`
}

Metadata ...

type Page

type Page struct {
	Type                             string         `json:"type"`
	DatasetId                        string         `json:"dataset_id"`
	DatasetTitle                     string         `json:"dataset_title"`
	URI                              string         `json:"uri"`
	Taxonomy                         []TaxonomyNode `json:"taxonomy"`
	Breadcrumb                       []TaxonomyNode `json:"breadcrumb"`
	IsInFilterBreadcrumb             bool           `json:"is_in_filter_breadcrumb"`
	ServiceMessage                   string         `json:"service_message"`
	Metadata                         Metadata       `json:"metadata"`
	SearchDisabled                   bool           `json:"search_disabled"`
	SiteDomain                       string         `json:"-"`
	PatternLibraryAssetsPath         string         `json:"-"`
	Language                         string         `json:"language"`
	IncludeAssetsIntegrityAttributes bool           `json:"-"`
	ReleaseDate                      string         `json:"release_date"`
	BetaBannerEnabled                bool           `json:"beta_banner_enabled"`
	CookiesPreferencesSet            bool           `json:"cookies_preferences_set"`
	CookiesPolicy                    CookiesPolicy  `json:"cookies_policy"`
	HasJSONLD                        bool           `json:"has_jsonld"`
	FeatureFlags                     FeatureFlags   `json:"feature_flags"`
}

Page contains data re-used for each page type a Data struct for data specific to the page type

func NewPage

func NewPage(path, domain string) Page

NewPage instantiates the base Page type with configurable fields

type PageToDisplay

type PageToDisplay struct {
	PageNumber int    `json:"page_number"`
	URL        string `json:"url"`
}

PageToDisplay represents a page to display in pagination with their corresponding URL

type Pagination

type Pagination struct {
	CurrentPage    int             `json:"current_page"`
	PagesToDisplay []PageToDisplay `json:"pages_to_display"`
	TotalPages     int             `json:"total_pages"`
	Limit          int             `json:"limit"`
	LimitOptions   []int           `json:"limit_options,omitempty"`
}

Pagination represents all information regarding pagination of search results

type TaxonomyNode

type TaxonomyNode struct {
	Title    string         `json:"title"`
	URI      string         `json:"uri"`
	Type     string         `json:"type,omitempty"`
	Children []TaxonomyNode `json:"children,omitempty"`
}

TaxonomyNode ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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