providers

package
v0.0.0-...-524353f Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package providers is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListProviders

func ListProviders() []string

Types

type ClientInterface

type ClientInterface interface {
	NewClient(token string, baseURL string)
	ListUsers(name string) ([]*gitlab.User, error)
	ListGroups(name string) ([]*gitlab.Group, error)
}

GitlabClient interface implements the Gitlab Client

type Gitlab

type Gitlab struct {
	Token   string
	BaseURL string
	Api     ClientInterface
}

Gitlab represents a Gitlab Client configuration

func (*Gitlab) GroupExists

func (g *Gitlab) GroupExists(name string) (bool, error)

SearchGroup searches a group by name

func (*Gitlab) Init

func (g *Gitlab) Init() error

Init initializes the Gitlab Client

func (*Gitlab) UserExists

func (g *Gitlab) UserExists(name string) (bool, error)

SearchUser searches a user by name

type GitlabClient

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

GitlabClient implements a wrapper for calling the gitlab library

func (*GitlabClient) ListGroups

func (c *GitlabClient) ListGroups(name string) ([]*gitlab.Group, error)

ListGroups returns a list of Gitlab users matching the name

func (*GitlabClient) ListUsers

func (c *GitlabClient) ListUsers(name string) ([]*gitlab.User, error)

ListUsers returns a list of Gitlab users matching the name

func (*GitlabClient) NewClient

func (c *GitlabClient) NewClient(Token string, BaseURL string)

NewClient returns a new Gitlab client

type MockClientInterface

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

MockClientInterface is a mock of ClientInterface interface

func NewMockClientInterface

func NewMockClientInterface(ctrl *gomock.Controller) *MockClientInterface

NewMockClientInterface creates a new mock instance

func (*MockClientInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockClientInterface) ListGroups

func (m *MockClientInterface) ListGroups(name string) ([]*gitlab.Group, error)

ListGroups mocks base method

func (*MockClientInterface) ListUsers

func (m *MockClientInterface) ListUsers(name string) ([]*gitlab.User, error)

ListUsers mocks base method

func (*MockClientInterface) NewClient

func (m *MockClientInterface) NewClient(Token, BaseURL string)

NewClient mocks base method

type MockClientInterfaceMockRecorder

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

MockClientInterfaceMockRecorder is the mock recorder for MockClientInterface

func (*MockClientInterfaceMockRecorder) ListGroups

func (mr *MockClientInterfaceMockRecorder) ListGroups(name interface{}) *gomock.Call

ListGroups indicates an expected call of ListGroups

func (*MockClientInterfaceMockRecorder) ListUsers

func (mr *MockClientInterfaceMockRecorder) ListUsers(name interface{}) *gomock.Call

ListUsers indicates an expected call of ListUsers

func (*MockClientInterfaceMockRecorder) NewClient

func (mr *MockClientInterfaceMockRecorder) NewClient(Token, BaseURL interface{}) *gomock.Call

NewClient indicates an expected call of NewClient

type Provider

type Provider interface {
	Init() error
	UserExists(username string) (bool, error)
	GroupExists(username string) (bool, error)
}

func InitProvider

func InitProvider(provider string, token string, baseURL string) (Provider, error)

Jump to

Keyboard shortcuts

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