fill

package
v0.0.0-...-e7db92f Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package fill acts as a sub-command, reading inotify events and forwarding them to the boldb backing the assemble server.

By default, the fill command is designed to listen for only open, close and delete events tying it to the Linux subsystem.

Whilst Windows/Mac can generate similar events, these are not handled by the `tiyo fill` application and as a result, this section of the application is not designed for those platforms.

Index

Constants

View Source
const MAXCLIENTS int = 100

MAXCLIENTS : The maximum number of http clients created by fill application

Variables

This section is empty.

Functions

This section is empty.

Types

type Fill

type Fill struct {

	// The filler object managed by this instance of the fill command
	Filler *Filler

	// Configuration of the fill command
	Config *config.Config

	// The pipeline being handled by this command
	Pipeline *pipeline.Pipeline

	// The name of the pipeline to load
	Name string

	// Command flags
	Flags *flag.FlagSet
}

Fill : Primary structure of the fill command

func NewFill

func NewFill() *Fill

NewFill Create a new fill command

func (*Fill) Init

func (fill *Fill) Init()

Init the command according to the flags and environment variables provided

func (*Fill) Run

func (fill *Fill) Run() int

Run the fill application to listen for monitored file events

type FilledFileEvent

type FilledFileEvent struct {

	// The name of the file being actioned
	Filename string

	// The bucket to write into
	Bucket string

	// Is this a file open event
	Opened bool

	// Is this a file close event
	Closed bool

	// Is this a file deleted event
	Deleted bool

	// the configuration object for the fill command
	// Can be a reduced config containing only assemble and
	// the sequence base directory
	Config *config.Config
}

FilledFileEvent : A file event to be sent to AssembleServer

func NewFillEvent

func NewFillEvent(config *config.Config, bucket string, filename string) *FilledFileEvent

NewFillEvent : Create a new fill event stream

func (*FilledFileEvent) Delete

func (event *FilledFileEvent) Delete()

Delete : Deletes an item from the boltdb - triggered on file deleted

func (*FilledFileEvent) JSONBody

func (event *FilledFileEvent) JSONBody(bucket string, key string) []byte

JSONBody : Construct the JSON object to send as part of the request

func (*FilledFileEvent) State

func (event *FilledFileEvent) State(notification notify.Event) *FilledFileEvent

State : Set the state of the event based on the inotify event

Only monitoring:

  • InOpen
  • InCloseWrite
  • Remove

func (*FilledFileEvent) Store

func (event *FilledFileEvent) Store()

Store : Store the event in the BoltDB

type Filler

type Filler struct {

	// A map of paths and events to watch
	Paths map[string]*FilledFileEvent

	// Configuration item for the fill command
	Config *config.Config
}

Filler : Struct for managing multiple event paths

func NewFiller

func NewFiller(config *config.Config) *Filler

NewFiller : Create a new filler instance for adding/deleting from the database

func (*Filler) Add

func (filler *Filler) Add(bucket string, dirname string, filename string, notification notify.Event)

Add : Add an event to the database

Jump to

Keyboard shortcuts

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