Documentation ¶
Index ¶
- Variables
- type Config
- func (cfg *Config) AuthRepo(repo string, pk ssh.PublicKey) gm.AccessLevel
- func (cfg *Config) Fetch(repo string, pk ssh.PublicKey)
- func (cfg *Config) KeyboardInteractiveHandler(ctx ssh.Context, _ gossh.KeyboardInteractiveChallenge) bool
- func (cfg *Config) PasswordHandler(ctx ssh.Context, password string) bool
- func (cfg *Config) PublicKeyHandler(ctx ssh.Context, pk ssh.PublicKey) bool
- func (cfg *Config) Push(repo string, pk ssh.PublicKey)
- func (cfg *Config) Reload() error
- type MenuRepo
- type Repo
- func (r *Repo) Commit(hash string) (*git.Commit, error)
- func (r *Repo) CommitsByPage(ref *git.Reference, page, size int) (git.Commits, error)
- func (r *Repo) CountCommits(ref *git.Reference) (int64, error)
- func (r *Repo) Description() string
- func (r *Repo) Diff(commit *git.Commit) (*git.Diff, error)
- func (r *Repo) HEAD() (*git.Reference, error)
- func (r *Repo) IsPrivate() bool
- func (r *Repo) LatestFile(pattern string) (string, string, error)
- func (r *Repo) Name() string
- func (r *Repo) Path() string
- func (r *Repo) Push(remote, branch string) error
- func (r *Repo) Readme() (readme string, path string)
- func (r *Repo) References() ([]*git.Reference, error)
- func (r *Repo) Repo() string
- func (r *Repo) SetReadme(readme, path string)
- func (r *Repo) Tree(ref *git.Reference, path string) (*git.Tree, error)
- func (r *Repo) UpdateServerInfo() error
- type RepoSource
- type User
Constants ¶
This section is empty.
Variables ¶
var ErrMissingRepo = errors.New("missing repo")
ErrMissingRepo indicates that the requested repository could not be found.
var ( // ErrNoConfig is returned when no config file is found. ErrNoConfig = errors.New("no config file found") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `yaml:"name" json:"name"` Host string `yaml:"host" json:"host"` Port int `yaml:"port" json:"port"` AnonAccess string `yaml:"anon-access" json:"anon-access"` AllowKeyless bool `yaml:"allow-keyless" json:"allow-keyless"` Users []User `yaml:"users" json:"users"` Repos []MenuRepo `yaml:"repos" json:"repos"` Source *RepoSource `yaml:"-" json:"-"` Cfg *config.Config `yaml:"-" json:"-"` // contains filtered or unexported fields }
Config is the Soft Serve configuration.
func (*Config) Fetch ¶ added in v0.4.0
Fetch registers Git fetch functionality for the given repo and key.
func (*Config) KeyboardInteractiveHandler ¶ added in v0.4.1
func (cfg *Config) KeyboardInteractiveHandler(ctx ssh.Context, _ gossh.KeyboardInteractiveChallenge) bool
KeyboardInteractiveHandler returns whether or not keyboard interactive is allowed.
func (*Config) PasswordHandler ¶ added in v0.4.0
PasswordHandler returns whether or not password access is allowed.
func (*Config) PublicKeyHandler ¶ added in v0.4.0
PublicKeyHandler returns whether or not the given public key may access the repo.
type MenuRepo ¶ added in v0.4.0
type MenuRepo struct { Name string `yaml:"name" json:"name"` Repo string `yaml:"repo" json:"repo"` Note string `yaml:"note" json:"note"` Private bool `yaml:"private" json:"private"` Readme string `yaml:"readme" json:"readme"` }
Repo contains repository configuration information.
type Repo ¶ added in v0.4.0
type Repo struct {
// contains filtered or unexported fields
}
Repo represents a Git repository.
func (*Repo) CommitsByPage ¶ added in v0.4.0
CommitsByPage returns the commits for a repository.
func (*Repo) CountCommits ¶ added in v0.4.0
CountCommits returns the number of commits for a repository.
func (*Repo) Description ¶ added in v0.4.0
Description returns the description for a repository.
func (*Repo) LatestFile ¶ added in v0.4.0
LatestFile returns the contents of the latest file at the specified path in the repository and its file path.
func (*Repo) References ¶ added in v0.4.0
GetReferences returns the references for a repository.
func (*Repo) UpdateServerInfo ¶ added in v0.4.0
UpdateServerInfo updates the server info for the repository.
type RepoSource ¶ added in v0.4.0
type RepoSource struct { Path string // contains filtered or unexported fields }
RepoSource is a reference to an on-disk repositories.
func NewRepoSource ¶ added in v0.4.0
func NewRepoSource(repoPath string) *RepoSource
NewRepoSource creates a new RepoSource.
func (*RepoSource) AllRepos ¶ added in v0.4.0
func (rs *RepoSource) AllRepos() []*Repo
AllRepos returns all repositories for the given RepoSource.
func (*RepoSource) GetRepo ¶ added in v0.4.0
func (rs *RepoSource) GetRepo(name string) (*Repo, error)
GetRepo returns a repository by name.
func (*RepoSource) InitRepo ¶ added in v0.4.0
func (rs *RepoSource) InitRepo(name string, bare bool) (*Repo, error)
InitRepo initializes a new Git repository.
func (*RepoSource) LoadRepo ¶ added in v0.4.0
func (rs *RepoSource) LoadRepo(name string) error
LoadRepo loads a repository from disk.
func (*RepoSource) LoadRepos ¶ added in v0.4.0
func (rs *RepoSource) LoadRepos() error
LoadRepos opens Git repositories.
type User ¶ added in v0.4.0
type User struct { Name string `yaml:"name" json:"name"` Admin bool `yaml:"admin" json:"admin"` PublicKeys []string `yaml:"public-keys" json:"public-keys"` CollabRepos []string `yaml:"collab-repos" json:"collab-repos"` }
User contains user-level configuration for a repository.