store

package
v0.0.0-...-5d16556 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoAccess    = 0
	PullAccess  = 1
	PushAccess  = 2
	AdminAccess = 3
	OwnerAccess = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLevel

type AccessLevel int

func ParseAccessLevel

func ParseAccessLevel(str string) (AccessLevel, error)

func (AccessLevel) String

func (level AccessLevel) String() string

type GinAuthStore

type GinAuthStore struct {
	URL string
}

func (*GinAuthStore) LookupUserBySSH

func (store *GinAuthStore) LookupUserBySSH(fingerprint string) (*User, error)

func (*GinAuthStore) TokenForUser

func (store *GinAuthStore) TokenForUser(uid string) (string, error)

func (*GinAuthStore) UserForRequest

func (store *GinAuthStore) UserForRequest(r *http.Request) (*User, error)

type LocalUserStore

type LocalUserStore struct {
	Path string
	// contains filtered or unexported fields
}

func (*LocalUserStore) LookupUserBySSH

func (store *LocalUserStore) LookupUserBySSH(fingerprint string) (*User, error)

func (*LocalUserStore) TokenForUser

func (store *LocalUserStore) TokenForUser(uid string) (string, error)

func (*LocalUserStore) UserForRequest

func (store *LocalUserStore) UserForRequest(r *http.Request) (*User, error)

type RepoId

type RepoId struct {
	Owner string
	Name  string
}

func RepoIdFromPath

func RepoIdFromPath(path string) (RepoId, error)

func RepoIdParse

func RepoIdParse(str string) (RepoId, error)

func (RepoId) String

func (id RepoId) String() string

type RepoStore

type RepoStore struct {
	Path string
}

func NewRepoStore

func NewRepoStore(basePath string) (*RepoStore, error)

func (*RepoStore) CreateRepo

func (store *RepoStore) CreateRepo(id RepoId) (*git.Repository, error)

func (*RepoStore) GetAccessLevel

func (store *RepoStore) GetAccessLevel(id RepoId, user string) (AccessLevel, error)

func (*RepoStore) GetRepoVisibility

func (store *RepoStore) GetRepoVisibility(id RepoId) (bool, error)

func (*RepoStore) IdToPath

func (store *RepoStore) IdToPath(id RepoId) string

IdToPath returns the complete path to the root folder of the repository referenced by the RepoId. Method does not check whether the repository actually exists.

func (*RepoStore) ListPublicRepos

func (store *RepoStore) ListPublicRepos() ([]RepoId, error)

func (*RepoStore) ListRepos

func (store *RepoStore) ListRepos() ([]RepoId, error)

func (*RepoStore) ListReposForUser

func (store *RepoStore) ListReposForUser(uid string) ([]RepoId, error)

func (*RepoStore) ListSharedAccess

func (store *RepoStore) ListSharedAccess(id RepoId) (map[string]AccessLevel, error)

func (*RepoStore) ListSharedRepos

func (store *RepoStore) ListSharedRepos(uid string) ([]RepoId, error)

func (*RepoStore) OpenGitRepo

func (store *RepoStore) OpenGitRepo(id RepoId) (*git.Repository, error)

func (*RepoStore) RepoExists

func (store *RepoStore) RepoExists(id RepoId) (bool, error)

RepoExists returns true if the path to a provided RepoId exists, false otherwise.

func (*RepoStore) SetAccessLevel

func (store *RepoStore) SetAccessLevel(id RepoId, user string, level AccessLevel) error

func (*RepoStore) SetRepoVisibility

func (store *RepoStore) SetRepoVisibility(id RepoId, public bool) error

type User

type User struct {
	Uid  string
	Keys []ssh.Key
}

type UserStore

type UserStore interface {
	LookupUserBySSH(fingerprint string) (*User, error)
	TokenForUser(uid string) (string, error)
	UserForRequest(r *http.Request) (*User, error)
}

func NewUserStore

func NewUserStore(base string) (UserStore, error)

Jump to

Keyboard shortcuts

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