hearings

package
v0.0.0-...-0fbf873 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Database  *database.Client
	Logger    *zerolog.Logger
	Scrapper  *scrapper.Scrapper
	Publisher *publisher.Publisher
}

Config for hearings service

type Parser

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

Parser is preparing data about public hearings

func NewParser

func NewParser() *Parser

NewParser return instance of public hearings parser

func (*Parser) Content

func (p *Parser) Content(hearing domain.Hearing) (domain.Hearing, error)

Content return full data of public hearing

type Service

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

Service to manage public hearings

func New

func New(cfg *Config) *Service

New returns an instance of hearing service

func (s Service) FetchLinks(ctx context.Context) ([]string, error)

FetchLinks of public hearings

func (Service) Find

func (s Service) Find(ctx context.Context, link string) (domain.Hearing, error)

Find public hearing by URL

func (Service) List

func (s Service) List(ctx context.Context) ([]domain.Hearing, error)

List of hearings

func (Service) ListUnpublished

func (s Service) ListUnpublished(ctx context.Context, mark bool) ([]domain.IHearing, error)

ListUnpublished returns list of unpublished hearings

func (Service) NewHearings

func (s Service) NewHearings(ctx context.Context) ([]domain.Hearing, error)

NewHearings returns list of new hearings from site

func (s Service) ProcessLink(ctx context.Context, link string) (domain.Hearing, error)

ProcessLink and get information about public hearing

func (Service) Publish

func (s Service) Publish(ctx context.Context, format string) (int, error)

Publish all unpublished hearings. Get it from DB and publish them one by one to telegram channel.

Jump to

Keyboard shortcuts

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