bot

package
v0.0.0-...-c21a6e6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BotId string

Functions

func AppendToFile

func AppendToFile[T any](fileName string, dataIn map[string]T) error

AppendToFile makes a number of attempts to call tryAppendFile. If it succeeds appending the data to file without error, it returns immediately. If an error occurs, it retries up to data.MaxWriteAttempts number of calls. If all write attempts fail, it tries writing the data to a backup file and returns an error

func OverwriteFile

func OverwriteFile[T any](fileName string, dataIn map[string]T) error

OverwriteFile works with any map[string]type. It attempts overwriting the file at path 'fileName' with the map passed to 'dataIn'. If any 'temporary' type errors are encountered, it retries overwriting up to 'MaxOverwriteAttempts' number of times. If all ovewrite attempts fail, it tries writing the data to a backup file of the same name. It returns an error if data was written to a backup file whether successful or not, or when non temporary error occurs.

func Start

func Start() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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