gandalf

package module
v0.0.0-...-9a76850 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

README

Go Gandalf Client is a client package for Gandalf

build status

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GitTimeFormat = "Mon Jan _2 15:04:05 2006 -0700"

Functions

This section is empty.

Types

type Author

type Author struct {
	Name  string
	Email string
	Date  GitTime
}

type Client

type Client struct {
	Endpoint string
}

func (*Client) AddKey

func (c *Client) AddKey(uName string, key map[string]string) error

AddKey adds keys to the user.

func (*Client) GetDiff

func (c *Client) GetDiff(repo, previousCommit, lastCommit string) (string, error)

GetDiff gets diff output between commits from a repository in Gandalf server.

func (*Client) GetHealthCheck

func (c *Client) GetHealthCheck() ([]byte, error)

GetHealthCheck gets healthcheck request output in Gandalf server.

func (*Client) GetLog

func (c *Client) GetLog(repo, ref, path string, total int) (Log, error)

func (*Client) GetRepository

func (c *Client) GetRepository(name string) (repository, error)

GetRepository gets metadata from a repository in Gandalf server.

func (*Client) GrantAccess

func (c *Client) GrantAccess(rNames, uNames []string) error

GrantAccess grants access to N users into N repositories.

func (*Client) ListKeys

func (c *Client) ListKeys(uName string) (map[string]string, error)

ListKeys retrieves all keys a given user has

func (*Client) NewRepository

func (c *Client) NewRepository(name string, users []string, isPublic bool) (repository, error)

NewRepository creates a new repository with a given name and, grants access to a list of users and defines whether the repository is public.

func (*Client) NewUser

func (c *Client) NewUser(name string, keys map[string]string) (user, error)

NewUser creates a new user with her/his given keys.

func (*Client) RemoveKey

func (c *Client) RemoveKey(uName, kName string) error

RemoveKey removes the key from the user.

func (*Client) RemoveRepository

func (c *Client) RemoveRepository(name string) error

RemoveRepository removes a repository.

func (*Client) RemoveUser

func (c *Client) RemoveUser(name string) error

RemoveUser removes a user.

func (*Client) RevokeAccess

func (c *Client) RevokeAccess(rNames, uNames []string) error

RevokeAccess revokes access from N users from N repositories.

func (*Client) UpdateKey

func (c *Client) UpdateKey(uName, kName, kBody string) error

type Commit

type Commit struct {
	Ref       string
	Author    Author
	Committer Author
	Subject   string
	CreatedAt GitTime
	Parent    []string
}

type GitTime

type GitTime time.Time

func (*GitTime) UnmarshalJSON

func (c *GitTime) UnmarshalJSON(raw []byte) error

type HTTPError

type HTTPError struct {
	Code   int
	Reason string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type Log

type Log struct {
	Commits []Commit
	Next    string
}

Jump to

Keyboard shortcuts

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