gitlab

package
v0.10.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package gitlab contains a directory provider for gitlab.

Index

Constants

View Source
const Name = "gitlab"

Name is the provider name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(cfg *config)

An Option updates the gitlab configuration.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient sets the http client option.

func WithServiceAccount

func WithServiceAccount(serviceAccount *ServiceAccount) Option

WithServiceAccount sets the service account in the config.

func WithURL

func WithURL(u *url.URL) Option

WithURL sets the api url in the config.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

The Provider retrieves users and groups from gitlab.

func New

func New(options ...Option) *Provider

New creates a new Provider.

func (*Provider) UserGroups

func (p *Provider) UserGroups(ctx context.Context) ([]*directory.Group, []*directory.User, error)

UserGroups gets the directory user groups for gitlab.

type ServiceAccount

type ServiceAccount struct {
	PrivateToken string `json:"private_token"`
}

A ServiceAccount is used by the Gitlab provider to query the Gitlab API.

func ParseServiceAccount

func ParseServiceAccount(rawServiceAccount string) (*ServiceAccount, error)

ParseServiceAccount parses the service account in the config options.

Jump to

Keyboard shortcuts

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