fabric

package module
v0.0.0-...-7c35933 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 16 Imported by: 1

README

Fabric

License

Fabric is licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigPath string
View Source
var (
	ErrProviderNotFound = fmt.Errorf("provider not found")
)

Functions

This section is empty.

Types

type BootableProvider

type BootableProvider interface {
	Name() string
	Priority() int
	Start() error
	Stop() error
}

type By

type By func(left, right BootableProvider) bool

By sorter.

func (By) Sort

func (by By) Sort(providers []BootableProvider)

Sort is a method on the function type, By, that sorts the argument slice according to the function.

type Configuration

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

func NewConfiguration

func NewConfiguration() (cfg *Configuration, err error)

func (*Configuration) ParseProvider

func (c *Configuration) ParseProvider(name string, v interface{}) hcl.Diagnostics

type Service

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

func NewService

func NewService(opts ...ServiceOption) (*Service, error)

func (*Service) Register

func (s *Service) Register(provider BootableProvider)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop() error

type ServiceLifeCycle

type ServiceLifeCycle interface {
	Register(provider BootableProvider)
	Start() error
	Stop() error
}

type ServiceOption

type ServiceOption func(*Service)

func Logger

func Logger(logger *slog.Logger) ServiceOption

func Name

func Name(name string) ServiceOption

func Version

func Version(version string) ServiceOption

Directories

Path Synopsis
cmd
demo module
provider

Jump to

Keyboard shortcuts

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