config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 4 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 {
	DbPath                string           `json:"dbpath"`
	Title                 string           `json:"title"`
	Repos                 map[string]*Repo `json:"repos"`
	MaxConcurrentIndexers int              `json:"max-concurrent-indexers"`
	HealthCheckURI        string           `json:"health-check-uri"`
}

func (*Config) LoadFromFile

func (c *Config) LoadFromFile(filename string) error

func (*Config) ToJsonString

func (c *Config) ToJsonString() (string, error)

type Repo

type Repo struct {
	Url               string         `json:"url"`
	MsBetweenPolls    int            `json:"ms-between-poll"`
	Vcs               string         `json:"vcs"`
	VcsConfigMessage  *SecretMessage `json:"vcs-config"`
	UrlPattern        *UrlPattern    `json:"url-pattern"`
	ExcludeDotFiles   bool           `json:"exclude-dot-files"`
	EnablePollUpdates *bool          `json:"enable-poll-updates"`
	EnablePushUpdates *bool          `json:"enable-push-updates"`
}

func (*Repo) PollUpdatesEnabled

func (r *Repo) PollUpdatesEnabled() bool

Are polling based updates enabled on this repo?

func (*Repo) PushUpdatesEnabled

func (r *Repo) PushUpdatesEnabled() bool

Are push based updates enabled on this repo?

func (*Repo) VcsConfig

func (r *Repo) VcsConfig() []byte

Get the JSON encode vcs-config for this repo. This returns nil if the repo doesn't declare a vcs-config.

type SecretMessage

type SecretMessage []byte

SecretMessage is just like json.RawMessage but it will not marshal its value as JSON. This is to ensure that vcs-config is not marshalled into JSON and send to the UI.

func (*SecretMessage) MarshalJSON

func (s *SecretMessage) MarshalJSON() ([]byte, error)

This always marshals to an empty object.

type UrlPattern

type UrlPattern struct {
	BaseUrl string `json:"base-url"`
	Anchor  string `json:"anchor"`
}

Jump to

Keyboard shortcuts

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