Skip to content
edgesync Artifact [d139c0b7d0]
Login

Artifact [d139c0b7d0]

Artifact d139c0b7d0708b4444480f4c9e1d80da365362ac8f83715262ccb07e0ef667c5:


package hub

// User describes a fossil user on the hub repo.
type User struct {
	Login string
	Caps  string
}

// AddUser creates a fossil user. Returns an error if Login is empty or the
// user already exists.
func (h *Hub) AddUser(u User) error { return h.repo.AddUser(u) }

// GetUser returns the user with the given login. Returns an error if no
// such user exists.
func (h *Hub) GetUser(login string) (User, error) { return h.repo.GetUser(login) }

// HasUser reports whether a user with the given login exists.
func (h *Hub) HasUser(login string) bool { return h.repo.HasUser(login) }

// ListUsers returns all users on the hub.
func (h *Hub) ListUsers() ([]User, error) { return h.repo.ListUsers() }

// RemoveUser deletes the user with the given login.
func (h *Hub) RemoveUser(login string) error { return h.repo.RemoveUser(login) }

// SetUserCaps replaces the caps string on an existing user.
func (h *Hub) SetUserCaps(login, caps string) error { return h.repo.SetUserCaps(login, caps) }