basics

package
v1.6.15 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoStart added in v0.3.20

type AutoStart interface {
	AutoStart()
}

AutoStart identify a peripheral object can be started automatically. see AddPeripheral.

type Basic

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

Basic is a base type to simplify your codes since you're using Peripheral type.

func (*Basic) AddPeripheral

func (s *Basic) AddPeripheral(peripherals ...Peripheral)

AddPeripheral adds a Peripheral object into Basic holder/host.

A peripheral represents an external resource such as redis manager which manages the links to remote redis server, etc.. A peripheral can be auto-started implicit by AddPeripheral while it implements AutoStart interface.

func (*Basic) Close

func (s *Basic) Close()

Close provides a closer to cleanup the peripheral gracefully

type Infrastructure added in v1.3.22

type Infrastructure interface {
	Peripheral

	// Open does initializing stuffs
	Open(ctx ctx.Context) (err error)
}

type OldInfra added in v1.3.22

type OldInfra interface {
	Open() error
}

type Peripheral

type Peripheral interface {
	// Close provides a closer to cleanup the peripheral gracefully
	Close()
}

Peripheral represents a basic infrastructure which can be initialized and destroyed.

For a Peripheral, the host should add it into a list and destroy them while host is shutting down.

Jump to

Keyboard shortcuts

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