Crate libbarto

Crate libbarto 

Source
Expand description

libbarto - This is the main library for barto, a job scheduling system.

§Features

  • A redb Key and Value implementation for bincode encoded/decoded data.
  • Shared message data structures
  • Client specific message data structures
  • Server specific message data structures
  • The Realtime struct for handling real-time scheduling.
  • TLS configuration loading.
  • Tracing initialization and configuration.
  • Common header output for startup.
  • Utility functions for parsing and sending pings/pongs.

Structs§

Actix
Configuration for the Actix web server
BartocInfo
bartoc client system information
Bartos
Used in bartoc configuration to define the bartos instance to connect to
Bincode
A generic newtype to handle redb keys and values that implement bincode::Encode and bincode::Decode
ClientData
bartoc client data
Command
A command to run on a worker
DayOfMonth
Represents a day of the month (1-31)
Dow
The day(s) of the week matcher
FailedOutput
The output of a Failed request
FileLayer
Tracing configuration
Garuda
A garuda-update message
HourOfDay
Represents an hour of the day (0-23)
Initialize
An initialization message from bartos to a named bartoc client.
Layer
Tracing configuration
ListOutput
The output of a List request, containing the names of all registered bartoc clients
Mariadb
The MariaDB configuration
MinuteOfHour
Represents a minute of the hour (0-59)
MonthOfYear
A month of the year (1-12)
OffsetDataTimeWrapper
An OffsetDateTime wrapper that implements bincode::Encode and bincode::Decode
Output
An output record from a bartoc client
Pacman
A garuda-update message
Realtime
A realtime schedule definition
Schedule
A schedule
Schedules
The schedule to run commands on a given worker client
SecondOfMinute
Represents a second of the minute (0-59)
Status
An output record from a bartoc client
Tls
TLS configuration for the Actix web server
Tracing
Tracing configuration
UuidWrapper
A Uuid wrapper that implements bincode::Encode and bincode::Decode

Enums§

BartoCli
Messages from barto-cli to bartos
Bartoc
A websocket binary message from bartoc to bartos
BartocWs
A supported websocket message from bartoc to bartos
BartosToBartoCli
A message from bartos to barto-cli
BartosToBartoc
A message from bartos to bartoc
CliUpdateKind
The update kind we are requesting
ConstrainedValue
A value constrained by specific rules (such as the day of the month)
Data
A record of data from a bartoc client
Error
Error types for the barto library
MissedTick
The output table name
OutputKind
The kind of output (stdout or stderr)
UpdateKind
The update kind

Traits§

Constrainable
A trait for types that can be constrained
ConstrainedValueMatcher
A trait for matching constrained values
ConstrainedValueParser
A trait for parsing constrained values
PathDefaults
Trait to allow default paths to be supplied to load
TlsConfig
A trait for types that provide TLS configuration details.
TracingConfigExt
Extension trait for TracingConfig to add additional configuration options

Functions§

clap_or_error
Converts an anyhow::Error into a suitable exit code or clap message for a CLI application.
clean_output_string
Clean an output string by removing tabs, new lines, carriage returns, and ANSI escape codes.
header
Generate a pretty header
init_tracing
Initialize tracing
load
Load the configuration
load_tls_config
Generates a ServerConfig for TLS using the provided configuration.
parse_ts_ping
Parse a received timestamp ping
send_ts_ping
Send a timestamp ping
success
Indicates successful execution of a function, returning exit code 0.
to_path_buf
Convert a string to a PathBuf

Type Aliases§

Day
Represents a constrained value for the day of the month (1-31)
Hour
Represents a constrained value matcher for hours of the day
Minute
Represents a constrained value matcher for minutes of the hour
Month
A constrained value representing a month of the year (1-12)
Second
Represents a constrained value matcher for seconds of the minute
Year
A year constraint for realtime schedules (i32::MIN..=i32::MAX)