namespacemembership

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package namespacemembership package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateNamespaceMembershipInput

type CreateNamespaceMembershipInput struct {
	User           *models.User
	ServiceAccount *models.ServiceAccount
	Team           *models.Team
	RoleID         string
	NamespacePath  string
}

CreateNamespaceMembershipInput is the input for creating a new namespace membership

type GetNamespaceMembershipsForSubjectInput

type GetNamespaceMembershipsForSubjectInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.NamespaceMembershipSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// UserID filters the namespace memberships by user ID
	UserID *string
	// ServiceAccount filters the namespace memberships by this service account
	ServiceAccount *models.ServiceAccount
}

GetNamespaceMembershipsForSubjectInput is the input for querying a list of namespace memberships

type MockService

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock type for the Service type

func NewMockService

func NewMockService(t mockConstructorTestingTNewMockService) *MockService

NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockService) CreateNamespaceMembership

func (_m *MockService) CreateNamespaceMembership(ctx context.Context, input *CreateNamespaceMembershipInput) (*models.NamespaceMembership, error)

CreateNamespaceMembership provides a mock function with given fields: ctx, input

func (*MockService) DeleteNamespaceMembership

func (_m *MockService) DeleteNamespaceMembership(ctx context.Context, namespaceMembership *models.NamespaceMembership) error

DeleteNamespaceMembership provides a mock function with given fields: ctx, namespaceMembership

func (*MockService) GetNamespaceMembershipByID

func (_m *MockService) GetNamespaceMembershipByID(ctx context.Context, id string) (*models.NamespaceMembership, error)

GetNamespaceMembershipByID provides a mock function with given fields: ctx, id

func (*MockService) GetNamespaceMembershipsByIDs

func (_m *MockService) GetNamespaceMembershipsByIDs(ctx context.Context, ids []string) ([]models.NamespaceMembership, error)

GetNamespaceMembershipsByIDs provides a mock function with given fields: ctx, ids

func (*MockService) GetNamespaceMembershipsForNamespace

func (_m *MockService) GetNamespaceMembershipsForNamespace(ctx context.Context, namespacePath string) ([]models.NamespaceMembership, error)

GetNamespaceMembershipsForNamespace provides a mock function with given fields: ctx, namespacePath

func (*MockService) GetNamespaceMembershipsForSubject

func (_m *MockService) GetNamespaceMembershipsForSubject(ctx context.Context, input *GetNamespaceMembershipsForSubjectInput) (*db.NamespaceMembershipResult, error)

GetNamespaceMembershipsForSubject provides a mock function with given fields: ctx, input

func (*MockService) UpdateNamespaceMembership

func (_m *MockService) UpdateNamespaceMembership(ctx context.Context, namespaceMembership *models.NamespaceMembership) (*models.NamespaceMembership, error)

UpdateNamespaceMembership provides a mock function with given fields: ctx, namespaceMembership

type Service

type Service interface {
	GetNamespaceMembershipsForNamespace(ctx context.Context, namespacePath string) ([]models.NamespaceMembership, error)
	GetNamespaceMembershipsForSubject(ctx context.Context, input *GetNamespaceMembershipsForSubjectInput) (*db.NamespaceMembershipResult, error)
	GetNamespaceMembershipByID(ctx context.Context, id string) (*models.NamespaceMembership, error)
	GetNamespaceMembershipsByIDs(ctx context.Context, ids []string) ([]models.NamespaceMembership, error)
	CreateNamespaceMembership(ctx context.Context, input *CreateNamespaceMembershipInput) (*models.NamespaceMembership, error)
	UpdateNamespaceMembership(ctx context.Context, namespaceMembership *models.NamespaceMembership) (*models.NamespaceMembership, error)
	DeleteNamespaceMembership(ctx context.Context, namespaceMembership *models.NamespaceMembership) error
}

Service implements all namespace membership related functionality

func NewService

func NewService(
	logger logger.Logger,
	dbClient *db.Client,
	activityService activityevent.Service,
) Service

NewService creates an instance of Service

Jump to

Keyboard shortcuts

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