common

package
v0.0.0-...-4093cd3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// When building to production set to true during compile time
	IsProduction = false
	CallbackPort = ":8080"
	ConfigDir    = filepath.Join(xdg.DataHome, "cc-printer")

	GlobalConfig *Config
	GlobalState  *State
)

Functions

func DeleteAppState

func DeleteAppState()

func InitLogging

func InitLogging()

Types

type Config

type Config struct {
	// AllowedSenders specifies only to prints files from Allowed Senders
	AllowedSenders []string
	// DeletePrinted specifies whether the email should be deleted after processing
	DeletePrinted bool
	// Printer is the printer to use; set to default to use default
	Printer string
	// PrintFlags are the flags to pass to CUPS (lp) command during printing
	PrintFlags []string
	// Provider used to pull emails from
	Provider string
	// Whether to reset state & config on launch
	Reset bool
}

Config for the printer

func FetchConfig

func FetchConfig() *Config

func (*Config) SaveToFile

func (c *Config) SaveToFile()

type State

type State struct {
	// lastFetch Last time the code fetched
	LastFetch time.Time
	// The encryption key stored in byte array
	EncryptionKey []byte
}

func FetchState

func FetchState() *State

func (*State) SaveToFile

func (s *State) SaveToFile()

Jump to

Keyboard shortcuts

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