config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 13 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 {
	Name         string `yaml:"name"`
	Host         string `yaml:"host"`
	Port         int    `yaml:"port"`
	AnonAccess   string `yaml:"anon-access"`
	AllowKeyless bool   `yaml:"allow-keyless"`
	Users        []User `yaml:"users"`
	Repos        []Repo `yaml:"repos"`
	Source       *git.RepoSource
	Cfg          *config.Config
}

func NewConfig

func NewConfig(cfg *config.Config) (*Config, error)

func (*Config) AuthRepo

func (cfg *Config) AuthRepo(repo string, pk ssh.PublicKey) gm.AccessLevel

func (*Config) Fetch

func (cfg *Config) Fetch(repo string, pk ssh.PublicKey)

func (*Config) PasswordHandler

func (cfg *Config) PasswordHandler(ctx ssh.Context, password string) bool

func (*Config) PublicKeyHandler

func (cfg *Config) PublicKeyHandler(ctx ssh.Context, pk ssh.PublicKey) bool

func (*Config) Push

func (cfg *Config) Push(repo string, pk ssh.PublicKey)

func (*Config) Reload

func (cfg *Config) Reload() error

type Repo

type Repo struct {
	Name    string `yaml:"name"`
	Repo    string `yaml:"repo"`
	Note    string `yaml:"note"`
	Private bool   `yaml:"private"`
}

type User

type User struct {
	Name        string   `yaml:"name"`
	Admin       bool     `yaml:"admin"`
	PublicKeys  []string `yaml:"public-keys"`
	CollabRepos []string `yaml:"collab-repos"`
}

Jump to

Keyboard shortcuts

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