infra

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverSqlite         = "sqlite"
	SourceSqliteInMemory = "file::memory:?cache=shared&_pragma=foreign_keys(1)"
)
View Source
const ErrNotReadDirFileFS = lib.Error("is not interface to fs.ReadDirFileFS")
View Source
const ErrWrongParamType = lib.Error("wrong param type")

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(log ports.Logger, driver, source string) (ports.DB, func(), error)

Types

type EventBus

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

func NewEventBus

func NewEventBus() *EventBus

func (*EventBus) Pub

func (e *EventBus) Pub(topic ports.Topic, event ports.Event)

func (*EventBus) Shutdown

func (e *EventBus) Shutdown()

func (*EventBus) Sub

func (e *EventBus) Sub(topic ports.Topic) chan ports.Event

Sub returns elastic channel subscribed to topic. The cskr/pubsub/v2 might suffer deadlocks, when subscribers are not reading out events fast enough.

func (*EventBus) Unsub

func (e *EventBus) Unsub(ch chan ports.Event)

type FileSystem

type FileSystem interface {
	fs.ReadFileFS
	fs.ReadDirFS
}

type LayerFileSystem

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

func NewLayerFileSystem

func NewLayerFileSystem(params ...interface{}) (*LayerFileSystem, error)

func (*LayerFileSystem) Open

func (l *LayerFileSystem) Open(name string) (fs.File, error)

func (*LayerFileSystem) ReadFile

func (l *LayerFileSystem) ReadFile(name string) ([]byte, error)

type MetaExport

type MetaExport struct {
}

func (*MetaExport) ParseMetaFile

func (*MetaExport) ParseMetaFile(f ports.FS, filename string) (map[string]string, error)

type Render

type Render = *render.Render

func NewRender

func NewRender(f fs.FS, layout string) Render

type Sha256

type Sha256 struct {
}

func (*Sha256) CheckFiles

func (s *Sha256) CheckFiles(f ports.FS, checksumFileName string) (ports.CheckedFiles, error)

CheckFiles return list of good/bad files as specified by checksumFileName or first error. Files must be returned with abs path

func (*Sha256) Sum

func (s *Sha256) Sum(f ports.FS, fileName string) ([]byte, error)

Sum return checksum of given file or error

type WatcherService

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

func NewWatcherService

func NewWatcherService(id string, log ports.Logger, bus ports.EventBus) (*WatcherService, error)

func (*WatcherService) Close

func (s *WatcherService) Close()

type WebServer

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

func NewWebServer

func NewWebServer(log ports.Logger, addr string, handler http.Handler) (*WebServer, error)

func (*WebServer) Close

func (s *WebServer) Close()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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