instance

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Provider providers.Config `json:"provider"`
}

Config is the structure of the configuration for a single TechDocs instance.

type Instance

type Instance interface {
	GetName() string
	GetIndexes(ctx context.Context) ([]shared.Index, error)
	GetIndex(ctx context.Context, service string) (*shared.Index, error)
	GetMarkdown(ctx context.Context, service, path string) (*shared.Markdown, error)
	GetFile(ctx context.Context, service, path string) ([]byte, error)
}

Instance is the interface which must be implemented by each TechDocs instance.

func New

func New(name string, options map[string]any) (Instance, error)

New returns a new TechDocs instance for the given configuration.

type MockInstance

type MockInstance struct {
	mock.Mock
}

MockInstance is an autogenerated mock type for the Instance type

func NewMockInstance

func NewMockInstance(t NewMockInstanceT) *MockInstance

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

func (*MockInstance) GetFile

func (_m *MockInstance) GetFile(ctx context.Context, service string, path string) ([]byte, error)

GetFile provides a mock function with given fields: ctx, service, path

func (*MockInstance) GetIndex

func (_m *MockInstance) GetIndex(ctx context.Context, service string) (*shared.Index, error)

GetIndex provides a mock function with given fields: ctx, service

func (*MockInstance) GetIndexes

func (_m *MockInstance) GetIndexes(ctx context.Context) ([]shared.Index, error)

GetIndexes provides a mock function with given fields: ctx

func (*MockInstance) GetMarkdown

func (_m *MockInstance) GetMarkdown(ctx context.Context, service string, path string) (*shared.Markdown, error)

GetMarkdown provides a mock function with given fields: ctx, service, path

func (*MockInstance) GetName

func (_m *MockInstance) GetName() string

GetName provides a mock function with given fields:

type NewMockInstanceT

type NewMockInstanceT interface {
	mock.TestingT
	Cleanup(func())
}

Jump to

Keyboard shortcuts

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