gen

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package gen is a generated GoMock package.

Copyright 2019 Canonical Ltd. Licensed under the AGPLv3, see LICENCE file for details.

Copyright 2020 Canonical Ltd. Licensed under the AGPLv3, see LICENCE file for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(g FacadeGroup, facades []facade.Details, registry Registry) []facade.Details

Filter the facades based on the group.

Types

type APIServer

type APIServer interface {
	AllFacades() Registry
	AdminFacadeDetails() []facade.Details
}

type FacadeGroup

type FacadeGroup string

FacadeGroup defines the grouping you want to export.

const (
	// Latest gets the latest facades from all the facades.
	Latest FacadeGroup = "latest"
	// All gets all the facades no matter the version.
	All FacadeGroup = "all"
	// Client facades returns just the client facades along with some required
	// facades that the client can use.
	Client FacadeGroup = "client"
	// JIMM facade group defines a very select set of facades that only work
	// with JIMM. This does not include the JIMM facade as defined in JIMM.
	JIMM FacadeGroup = "jimm"
)

func ParseFacadeGroup

func ParseFacadeGroup(s string) (FacadeGroup, error)

ParseFacadeGroup will attempt to parse the facade group

type FacadeSchema

type FacadeSchema struct {
	Name        string
	Description string
	Version     int
	AvailableTo []string
	Schema      *jsonschema.Schema
}

func Generate

func Generate(pkgRegistry PackageRegistry, linker Linker, client APIServer, options ...Option) ([]FacadeSchema, error)

Generate a FacadeSchema from the APIServer

type Linker

type Linker interface {
	Links(string, facade.Factory) []string
}

type MockAPIServer

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

MockAPIServer is a mock of APIServer interface

func NewMockAPIServer

func NewMockAPIServer(ctrl *gomock.Controller) *MockAPIServer

NewMockAPIServer creates a new mock instance

func (*MockAPIServer) AdminFacadeDetails

func (m *MockAPIServer) AdminFacadeDetails() []facade.Details

AdminFacadeDetails mocks base method

func (*MockAPIServer) AllFacades

func (m *MockAPIServer) AllFacades() Registry

AllFacades mocks base method

func (*MockAPIServer) EXPECT

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

type MockAPIServerMockRecorder

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

MockAPIServerMockRecorder is the mock recorder for MockAPIServer

func (*MockAPIServerMockRecorder) AdminFacadeDetails

func (mr *MockAPIServerMockRecorder) AdminFacadeDetails() *gomock.Call

AdminFacadeDetails indicates an expected call of AdminFacadeDetails

func (*MockAPIServerMockRecorder) AllFacades

func (mr *MockAPIServerMockRecorder) AllFacades() *gomock.Call

AllFacades indicates an expected call of AllFacades

type MockLinker

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

MockLinker is a mock of Linker interface

func NewMockLinker

func NewMockLinker(ctrl *gomock.Controller) *MockLinker

NewMockLinker creates a new mock instance

func (*MockLinker) EXPECT

func (m *MockLinker) EXPECT() *MockLinkerMockRecorder

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

func (m *MockLinker) Links(arg0 string, arg1 facade.Factory) []string

Links mocks base method

type MockLinkerMockRecorder

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

MockLinkerMockRecorder is the mock recorder for MockLinker

func (mr *MockLinkerMockRecorder) Links(arg0, arg1 interface{}) *gomock.Call

Links indicates an expected call of Links

type MockPackageRegistry

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

MockPackageRegistry is a mock of PackageRegistry interface

func NewMockPackageRegistry

func NewMockPackageRegistry(ctrl *gomock.Controller) *MockPackageRegistry

NewMockPackageRegistry creates a new mock instance

func (*MockPackageRegistry) EXPECT

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

func (*MockPackageRegistry) LoadPackage

func (m *MockPackageRegistry) LoadPackage() (*packages.Package, error)

LoadPackage mocks base method

type MockPackageRegistryMockRecorder

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

MockPackageRegistryMockRecorder is the mock recorder for MockPackageRegistry

func (*MockPackageRegistryMockRecorder) LoadPackage

func (mr *MockPackageRegistryMockRecorder) LoadPackage() *gomock.Call

LoadPackage indicates an expected call of LoadPackage

type MockRegistry

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

MockRegistry is a mock of Registry interface

func NewMockRegistry

func NewMockRegistry(ctrl *gomock.Controller) *MockRegistry

NewMockRegistry creates a new mock instance

func (*MockRegistry) EXPECT

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

func (*MockRegistry) GetType

func (m *MockRegistry) GetType(arg0 string, arg1 int) (reflect.Type, error)

GetType mocks base method

func (*MockRegistry) List

func (m *MockRegistry) List() []facade.Description

List mocks base method

func (*MockRegistry) ListDetails

func (m *MockRegistry) ListDetails() []facade.Details

ListDetails mocks base method

type MockRegistryMockRecorder

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

MockRegistryMockRecorder is the mock recorder for MockRegistry

func (*MockRegistryMockRecorder) GetType

func (mr *MockRegistryMockRecorder) GetType(arg0, arg1 interface{}) *gomock.Call

GetType indicates an expected call of GetType

func (*MockRegistryMockRecorder) List

func (mr *MockRegistryMockRecorder) List() *gomock.Call

List indicates an expected call of List

func (*MockRegistryMockRecorder) ListDetails

func (mr *MockRegistryMockRecorder) ListDetails() *gomock.Call

ListDetails indicates an expected call of ListDetails

type Option

type Option func(*options)

Option to be passed to Connect to customize the resulting instance.

func WithAdminFacades

func WithAdminFacades(adminFacades bool) Option

WithAdminFacades sets the adminFacades on the option

func WithFacadeGroups

func WithFacadeGroups(facadeGroups []FacadeGroup) Option

WithFacadeGroups sets the facadeGroups on the option

type PackageRegistry

type PackageRegistry interface {
	LoadPackage() (*packages.Package, error)
}

type Registry

type Registry interface {
	List() []facade.Description
	ListDetails() []facade.Details
	GetType(name string, version int) (reflect.Type, error)
}

Jump to

Keyboard shortcuts

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