Documentation
¶
Index ¶
- func GetStaticSitemap(filename string) ([]byte, error)
- func LoadStaticSitemap(cfg *config.Config, ...) error
- type Adder
- type AlternateURL
- type AlternateURLReader
- type DefaultAdder
- type ElasticFetcher
- func (f *ElasticFetcher) GetFullSitemap(ctx context.Context) (fileNames Files, err error)
- func (f *ElasticFetcher) GetPageInfo(ctx context.Context, path string) (*PageInfo, error)
- func (f *ElasticFetcher) HasWelshContent(ctx context.Context, path string) bool
- func (f *ElasticFetcher) URLVersion(ctx context.Context, path, lastmod, lang string) *URL
- func (f *ElasticFetcher) URLVersions(ctx context.Context, path, lastmod string) (en, cy *URL)
- type ElasticHit
- type ElasticHitSource
- type ElasticResult
- type ElasticScroll
- type Fetcher
- type FileStore
- type Files
- type Generator
- func (g *Generator) AppendURL(ctx context.Context, sitemap io.ReadCloser, url *URL, destination string) (int, error)
- func (g *Generator) MakeFullSitemap(ctx context.Context) error
- func (g *Generator) MakePublishingSitemap(ctx context.Context, url URL) error
- func (g *Generator) TruncatePublishingSitemap(ctx context.Context) error
- type GeneratorOptions
- func WithAdder(a Adder) GeneratorOptions
- func WithFetcher(f Fetcher) GeneratorOptions
- func WithFileStore(s FileStore) GeneratorOptions
- func WithFullSitemapFiles(f Files) GeneratorOptions
- func WithPublishingSitemapFile(f string) GeneratorOptions
- func WithPublishingSitemapMaxSize(size int, callback func()) GeneratorOptions
- type LocalStore
- func (s *LocalStore) CopyFile(src io.Reader, dest io.Writer) error
- func (s *LocalStore) CreateFile(name string) (io.ReadWriteCloser, error)
- func (s *LocalStore) DeleteFile(name string) error
- func (s *LocalStore) GetFile(name string) (body io.ReadCloser, err error)
- func (s *LocalStore) SaveFile(name string, body io.Reader) error
- type PageInfo
- type S3Client
- type S3Store
- func (s *S3Store) CopyFile(_ io.Reader, _ io.Writer) error
- func (s *S3Store) CreateFile(_ string) (io.ReadWriteCloser, error)
- func (s *S3Store) DeleteFile(_ string) error
- func (s *S3Store) GetFile(name string) (body io.ReadCloser, err error)
- func (s *S3Store) SaveFile(name string, body io.Reader) error
- type Scroll
- type StaticURL
- type URL
- type URLReader
- type Urlset
- type UrlsetReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStaticSitemap ¶
Types ¶
type AlternateURL ¶
type AlternateURLReader ¶
type DefaultAdder ¶
type DefaultAdder struct{}
type ElasticFetcher ¶
type ElasticFetcher struct {
// contains filtered or unexported fields
}
func NewElasticFetcher ¶
func NewElasticFetcher(scroll Scroll, cfg *config.Config, zc clients.ZebedeeClient) *ElasticFetcher
func (*ElasticFetcher) GetFullSitemap ¶
func (f *ElasticFetcher) GetFullSitemap(ctx context.Context) (fileNames Files, err error)
func (*ElasticFetcher) GetPageInfo ¶
func (*ElasticFetcher) HasWelshContent ¶
func (f *ElasticFetcher) HasWelshContent(ctx context.Context, path string) bool
func (*ElasticFetcher) URLVersion ¶
func (f *ElasticFetcher) URLVersion(ctx context.Context, path, lastmod, lang string) *URL
func (*ElasticFetcher) URLVersions ¶
func (f *ElasticFetcher) URLVersions(ctx context.Context, path, lastmod string) (en, cy *URL)
type ElasticHit ¶
type ElasticHit struct {
Index string `json:"_index"`
Type string `json:"_type"`
ID string `json:"_id"`
Score interface{} `json:"_score"`
Source ElasticHitSource `json:"_source"`
Sort []string `json:"sort"`
}
type ElasticHitSource ¶
type ElasticHitSource struct {
Type string `json:"type"`
URI string `json:"uri"`
JobID string `json:"job_id"`
SearchIndex string `json:"search_index"`
Cdid string `json:"cdid"`
DatasetID string `json:"dataset_id"`
Edition string `json:"edition"`
Keywords []string `json:"keywords"`
MetaDescription string `json:"meta_description"`
ReleaseDate time.Time `json:"release_date"`
Summary string `json:"summary"`
Title string `json:"title"`
Topics interface{} `json:"topics"`
Cancelled bool `json:"cancelled"`
Finalised bool `json:"finalised"`
Published bool `json:"published"`
CanonicalTopic string `json:"canonical_topic"`
}
type ElasticResult ¶
type ElasticResult struct {
ScrollID string `json:"_scroll_id"`
Took int `json:"took"`
TimedOut bool `json:"timed_out"`
Shards struct {
Total int `json:"total"`
Successful int `json:"successful"`
Skipped int `json:"skipped"`
Failed int `json:"failed"`
} `json:"_shards"`
Hits struct {
Total struct {
Value int `json:"value"`
Relation string `json:"relation"`
} `json:"total"`
MaxScore interface{} `json:"max_score"`
Hits []ElasticHit `json:"hits"`
} `json:"hits"`
}
type ElasticScroll ¶
type ElasticScroll struct {
// contains filtered or unexported fields
}
func NewElasticScroll ¶
func NewElasticScroll(elastic *es710.Client, cfg *config.Config) *ElasticScroll
func (*ElasticScroll) GetScroll ¶
func (f *ElasticScroll) GetScroll(ctx context.Context, id string, result interface{}) error
func (*ElasticScroll) StartScroll ¶
func (f *ElasticScroll) StartScroll(ctx context.Context, result interface{}) error
type Fetcher ¶
type Fetcher interface {
GetFullSitemap(ctx context.Context) (Files, error)
HasWelshContent(ctx context.Context, path string) bool
URLVersions(ctx context.Context, path string, lastmod string) (en, cy *URL)
URLVersion(ctx context.Context, path, lastmod, lang string) *URL
GetPageInfo(ctx context.Context, path string) (*PageInfo, error)
}
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator(opts ...GeneratorOptions) *Generator
func (*Generator) MakePublishingSitemap ¶
type GeneratorOptions ¶
func WithAdder ¶
func WithAdder(a Adder) GeneratorOptions
func WithFetcher ¶
func WithFetcher(f Fetcher) GeneratorOptions
func WithFileStore ¶
func WithFileStore(s FileStore) GeneratorOptions
func WithFullSitemapFiles ¶
func WithFullSitemapFiles(f Files) GeneratorOptions
func WithPublishingSitemapFile ¶
func WithPublishingSitemapFile(f string) GeneratorOptions
func WithPublishingSitemapMaxSize ¶
func WithPublishingSitemapMaxSize(size int, callback func()) GeneratorOptions
type LocalStore ¶
type LocalStore struct{}
func (*LocalStore) CreateFile ¶
func (s *LocalStore) CreateFile(name string) (io.ReadWriteCloser, error)
func (*LocalStore) DeleteFile ¶ added in v0.2.1
func (s *LocalStore) DeleteFile(name string) error
func (*LocalStore) GetFile ¶
func (s *LocalStore) GetFile(name string) (body io.ReadCloser, err error)
type S3Client ¶
type S3Client interface {
Upload(input *s3manager.UploadInput, options ...func(*s3manager.Uploader)) (*s3manager.UploadOutput, error)
Get(key string) (io.ReadCloser, *int64, error)
BucketName() string
}
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
func NewS3Store ¶
func (*S3Store) CreateFile ¶
func (s *S3Store) CreateFile(_ string) (io.ReadWriteCloser, error)
func (*S3Store) DeleteFile ¶ added in v0.2.1
type URL ¶
type URL struct {
XMLName xml.Name `xml:"url"`
Loc string `xml:"loc"`
Lastmod string `xml:"lastmod"`
Alternate *AlternateURL `xml:"xhtml:link,omitempty"`
}
type URLReader ¶
type URLReader struct {
XMLName xml.Name `xml:"url"`
Loc string `xml:"loc"`
Lastmod string `xml:"lastmod"`
Alternate *AlternateURLReader `xml:"link,omitempty"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.