providers

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 7 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 {
	Type  Type         `json:"type"`
	Local local.Config `json:"local"`
	S3    s3.Config    `json:"s3"`
}

Config is the structure of the provider config for a TechDocs instance.

type Provider

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

Provider is the interface, which must be implemented by each TechDocs provider.

func New

func New(config Config) (Provider, error)

New returns a new provider for the given configuration.

type Type

type Type string

Type is the type for the different providers.

const (
	// LOCAL is the type for the local file system provider, which returns TechDocs from the local file system.
	LOCAL Type = "local"
	// S3 is the type for the S3 provider, which returns TechDocs saved in a S3 bucket.
	S3 Type = "s3"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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