config

package
v0.0.1-0...-46c5078 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfigFile = errors.New("invalid config file")

ErrInvalidConfigFile is returned when the config file is invalid.

Functions

func WithContext

func WithContext(ctx context.Context, c Config) context.Context

Types

type Auth

type Auth struct {
	Token string `json:"token"`
}

func (*Auth) EffectiveToken

func (a *Auth) EffectiveToken() string

type Config

type Config struct {
	Sites []Site `json:"sites"`
}

func FromContext

func FromContext(ctx context.Context) Config

func Load

func Load(ctx context.Context, file string) (Config, error)

func (Config) Merge

func (c Config) Merge(cfg Config) Config

func (Config) Site

func (c Config) Site(site string) Site

type Site

type Site struct {
	Type    `json:"type"`
	Address string `json:"address"`
	*Auth   `json:"auth"`
}

func (Site) Match

func (s Site) Match(site Site) bool

func (Site) Merge

func (s Site) Merge(override Site) Site

type Type

type Type string
const (
	TypeGitHub Type = "github"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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