bsbord

package
v0.2.0-dev.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bsbord adds the paid mobile-network reachability source to the country check.

Index

Constants

View Source
const (
	Source = countryreach.SourceBsbord

	DefaultIntervalMin = 1440
	MinIntervalMin     = 60
	MaxIntervalMin     = 1440
	DefaultCapCredits  = 10000 // 100 RUB; one credit is one kopeck.
	MaxCapCredits      = 1000000000
)
View Source
const (
	DefaultBaseURL = "https://bsbord.com"
)

Variables

This section is empty.

Functions

func StateFrom

func StateFrom(kv map[string]string) health.ExternalState

StateFrom is State from the values of StateKeys.

func StateKeys

func StateKeys() []string

StateKeys are the settings State reads; StateFrom builds it from their values.

Types

type Config

type Config struct {
	Store      *store.Store
	Vault      *vault.Vault
	StepUp     func(context.Context) error
	Country    func(context.Context) string
	Targets    func(context.Context) ([]health.CountryTarget, error)
	HTTPClient *http.Client
	BaseURL    string // tests supply an httptest URL; empty uses the production API host.
	Edge       bool
	RoundLease func(ctx context.Context, name string, ttl time.Duration) bool
	OnChange   func(context.Context)
	Log        *slog.Logger
	Now        func() time.Time
}

Config configures Service. Store, Vault, StepUp and Targets are required.

type Service

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

func New

func New(cfg Config) (*Service, error)

func (*Service) Handler

func (s *Service) Handler(opts ...connect.HandlerOption) (string, http.Handler)

func (*Service) Run

func (s *Service) Run(ctx context.Context)

Run is the VPS scheduler. The edge calls Tick from its bounded cron pass.

func (*Service) State

func (s *Service) State(ctx context.Context) health.ExternalState

State is the settings-only view of this source for health.Config.External: one batched settings read, no network. It is read on every checks, history and evaluator pass.

func (*Service) Tick

func (s *Service) Tick(ctx context.Context)

Tick runs at most one paid request. A large fleet's remaining chunks stay in the pending record for the next tick.

Jump to

Keyboard shortcuts

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