server

package
v0.3.1-direct-header-i... Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = fmt.Errorf("not found")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	PollInterval time.Duration
	Proxy        bool
}

type Documentation

type Documentation struct {
	// The version of this documentation
	Version string
	// The different files in this version
	Files []string
}

type Provider

type Provider interface {
	ListVersions(ctx context.Context) ([]string, error)
	ListFiles(ctx context.Context, version string) ([]string, error)
	GetPath(version, file string) string
	DownloadFile(ctx context.Context, version, file string) ([]byte, error)
}

type Server

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

func New

func New(cfg *Config, provider Provider) (*Server, error)

func (*Server) FetchVersion

func (s *Server) FetchVersion(ctx context.Context, version string) error

func (*Server) GetFile

func (s *Server) GetFile(ctx context.Context, version, file string) ([]byte, error)

func (*Server) GetVersion

func (s *Server) GetVersion(version string) *Documentation

func (*Server) GetVersions

func (s *Server) GetVersions() []string

func (*Server) Path

func (s *Server) Path(version, role string) string

func (*Server) Poll

func (s *Server) Poll(ctx context.Context) error

Poll polls the provider for new versions and files.

func (*Server) ProxyEnabled

func (s *Server) ProxyEnabled() bool

func (*Server) RemoveVersion

func (s *Server) RemoveVersion(version string)

func (*Server) Run

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

Jump to

Keyboard shortcuts

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