repository

package
v0.0.0-...-9451de5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package repository contains types and functions for git repository interaction.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound            = errors.New("key not found")
	ErrRepositoryNotFound     = errors.New("repository not found")
	ErrUserNotFound           = errors.New("user not found")
	ErrKeyAlreadyExists       = errors.New("user already have this key")
	ErrRepositoryAlreadExists = errors.New("repository already exists")
	ErrUserAlreadyExists      = errors.New("user already exists")
)

Functions

func Register

func Register(name string, manager RepositoryManager)

Register registers a new repository manager, that can be later configured and used.

Types

type Key

type Key struct {
	Name string
	Body string
}

Key represents a public key, that is added to a repository to allow access to it.

type KeyRepositoryManager

type KeyRepositoryManager interface {
	AddKey(username string, key Key) error
	UpdateKey(username string, key Key) error
	RemoveKey(username string, key Key) error
	ListKeys(username string) ([]Key, error)
}

KeyRepositoryManager is a RepositoryManager that is able to manage public SSH keys.

type Repository

type Repository struct {
	Name         string
	ReadWriteURL string
}

Repository represents a repository in the manager.

type RepositoryManager

type RepositoryManager interface {
	CreateUser(username string) error
	RemoveUser(username string) error

	GrantAccess(repository, user string) error
	RevokeAccess(repository, user string) error

	CreateRepository(name string, users []string) error
	RemoveRepository(name string) error
	GetRepository(name string) (Repository, error)

	Diff(repositoryName, fromVersion, toVersion string) (string, error)

	CommitMessages(repository, ref string, limit int) ([]string, error)
}

RepositoryManager represents a manager of application repositories.

func Manager

func Manager() RepositoryManager

Manager returns the current configured manager, as defined in the configuration file.

Directories

Path Synopsis
Package gandalf provides an implementation of the RepositoryManager, that uses Gandalf (https://github.com/tsuru/gandalf).
Package gandalf provides an implementation of the RepositoryManager, that uses Gandalf (https://github.com/tsuru/gandalf).
Package repositorytest provides a fake repository manager for use in tests.
Package repositorytest provides a fake repository manager for use in tests.

Jump to

Keyboard shortcuts

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