Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config map[string]ProjectConfig
Config is a map from hosts to project configurations.
func LoadConfig ¶
LoadConfig loads the config from the given file.
func (Config) MinVersionForHost ¶
MinVersionForHost will return the minimum version for a project at the given host. It will return nil if no such host can be found or if the version is not valid or is missing. The host will have its port, if any, stripped.
func (Config) ProjectForHost ¶
ProjectForHost will returns the owner and repository name of the project in the given host. Will also report whether or not the project could be found with a boolean. The host will have its port, if any, stripped.
type Options ¶
type Options struct { // GitHubAPIKey is the API key used to retrieve releases from GitHub. // If api key is empty the requests will be made without authentication. GitHubAPIKey string // BaseFolder is the path to the root folder of the webserver. BaseFolder string // assets for building the documentations. SharedFolder string // RefreshToken is a key that allows refreshing the cache before a regular // refresh on a request. RefreshToken string // Config is a mapping between hosts and project configurations. Config Config }
Options contains all the options available for creating a new DocSrv service.
type ProjectConfig ¶
type ProjectConfig struct { // Repository is the repository this project maps to in the format "${OWNER}/${PROJECT}". Repository string `toml:"repository"` // MinVersion is the minimum version of this project for which documentation // sites can be built. MinVersion string `toml:"min-version"` }
ProjectConfig represents a single project configuration.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the main docsrv service.
func (*Service) ManageIndex ¶
ManageIndex is in charge of refreshing the index of projects every five minutes until the given context is cancelled.