Documentation
¶
Index ¶
- Constants
- type AccessLevel
- type GinAuthStore
- type LocalUserStore
- type RepoId
- type RepoStore
- func (store *RepoStore) CreateRepo(id RepoId) (*git.Repository, error)
- func (store *RepoStore) GetAccessLevel(id RepoId, user string) (AccessLevel, error)
- func (store *RepoStore) GetRepoVisibility(id RepoId) (bool, error)
- func (store *RepoStore) IdToPath(id RepoId) string
- func (store *RepoStore) ListPublicRepos() ([]RepoId, error)
- func (store *RepoStore) ListRepos() ([]RepoId, error)
- func (store *RepoStore) ListReposForUser(uid string) ([]RepoId, error)
- func (store *RepoStore) ListSharedAccess(id RepoId) (map[string]AccessLevel, error)
- func (store *RepoStore) ListSharedRepos(uid string) ([]RepoId, error)
- func (store *RepoStore) OpenGitRepo(id RepoId) (*git.Repository, error)
- func (store *RepoStore) RepoExists(id RepoId) (bool, error)
- func (store *RepoStore) SetAccessLevel(id RepoId, user string, level AccessLevel) error
- func (store *RepoStore) SetRepoVisibility(id RepoId, public bool) error
- type User
- type UserStore
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 RepoStore ¶
type RepoStore struct {
Path string
}
func NewRepoStore ¶
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 (*RepoStore) IdToPath ¶
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 (*RepoStore) ListReposForUser ¶
func (*RepoStore) ListSharedAccess ¶
func (store *RepoStore) ListSharedAccess(id RepoId) (map[string]AccessLevel, error)
func (*RepoStore) ListSharedRepos ¶
func (*RepoStore) OpenGitRepo ¶
func (store *RepoStore) OpenGitRepo(id RepoId) (*git.Repository, error)
func (*RepoStore) RepoExists ¶
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
Click to show internal directories.
Click to hide internal directories.