config

package
v0.0.0-...-727149a Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const BUFFER_SIZE int = 4096

todo: use circl from cloudfare to encrypt data post quantum crystals-kyber, crystals-dilithium, sphincs=, FALCON

View Source
const IV_SIZE int = 16
View Source
const MySecret string = "abd&1*~#^2^#s0^=)^^7%c34" // must be 24 characters
View Source
const Password = "123456" // default password shipped with app

default gui password

Variables

View Source
var CategoriesStore = make(map[int]CategoriesStruct)
View Source
var CategoryArray []string
View Source
var DBClientcert = "" /* 1042-byte string literal not displayed */
View Source
var DBClientkey = "" /* 1732-byte string literal not displayed */
View Source
var DBaddress = "db.newhorizons3000.org:5432/radio?sslmode=verify-ca"

var DBaddress = "localhost:5432/radio"

View Source
var DBpassword = "postgres"
View Source
var DBuser = "postgres"
View Source
var Dark = 0
View Source
var DarkButton = color.RGBA{187, 188, 201, 32}

var DarkButton = color.RGBA{162, 168, 250, 64}

View Source
var DarkDisabled = color.RGBA{187, 188, 201, 64}
View Source
var DarkFocus = color.RGBA{187, 188, 201, 64}
View Source
var DarkHover = color.RGBA{187, 188, 201, 64}
View Source
var DarkHyperlink = color.RGBA{187, 188, 201, 255}
View Source
var DarkInputBackground = color.RGBA{187, 188, 201, 32}
View Source
var DarkInputBorder = color.RGBA{187, 188, 201, 64}
View Source
var DarkPlaceholder = color.RGBA{187, 188, 201, 220}
View Source
var DarkPressed = color.RGBA{187, 188, 201, 220}
View Source
var DarkPrimary = color.RGBA{187, 188, 201, 255}
View Source
var DarkScrollBar = color.RGBA{187, 188, 201, 64}
View Source
var DarkSelection = color.RGBA{187, 188, 201, 128}
View Source
var DarkSeparator = color.RGBA{187, 188, 201, 64}
View Source
var DarkShadow = color.RGBA{187, 188, 201, 64}
View Source
var DaysStore = make(map[int]DaysStruct)
View Source
var DevCancel = false
View Source
var FyneApp fyne.App
View Source
var FyneDaysList fyne.Widget
View Source
var FyneDeviceList fyne.Widget
View Source
var FyneDeviceWin fyne.Window
View Source
var FyneFilter bool
View Source
var FyneFilterDevices bool
View Source
var FyneInventoryList fyne.Widget
View Source
var FyneMainWin fyne.Window
View Source
var FyneMessageList fyne.Widget
View Source
var FyneMessageWin fyne.Window
View Source
var HoursStore = make(map[int]HoursStruct)
View Source
var InventoryStore = make(map[int]InventoryStruct)
View Source
var KeyAes = []byte{35, 46, 57, 24, 85, 35, 24, 74, 87, 35, 88, 98, 66, 32, 14, 05} // must be 16 bytes

default encryption

View Source
var KeyHmac = []byte{36, 45, 53, 21, 87, 35, 24, 74, 87, 35, 88, 98, 66, 32, 14, 05} // must be 16 bytes
View Source
var Light = 1
View Source
var LightButton = color.RGBA{129, 137, 252, 250}
View Source
var LightDisabled = color.RGBA{129, 137, 252, 64}
View Source
var LightFocus = color.RGBA{129, 137, 252, 64}
View Source
var LightHover = color.RGBA{129, 137, 252, 250}
View Source
var LightHyperlink = color.RGBA{129, 137, 252, 1}
View Source
var LightInputBackground = color.RGBA{129, 137, 252, 32}
View Source
var LightInputBorder = color.RGBA{129, 137, 252, 250}
View Source
var LightPlaceholder = color.RGBA{129, 137, 252, 220}
View Source
var LightPressed = color.RGBA{129, 137, 252, 220}
View Source
var LightPrimary = color.RGBA{129, 137, 252, 255}
View Source
var LightScrollBar = color.RGBA{129, 137, 252, 250}
View Source
var LightSelection = color.RGBA{129, 137, 252, 200}
View Source
var LightSeparator = color.Black
View Source
var LightShadow = color.RGBA{129, 137, 252, 64}
View Source
var LoggedOn bool
View Source
var MessageToSend string
View Source
var MsgCancel = false

var NatsCONSUMER nats.JetStream var NatsJETSTREAM nats.JetStream

View Source
var MyLangs = map[string]string{}/* 417 elements not displayed */

eng esp cmn

View Source
var NATSSTREAM = "NATS"
View Source
var NatsAdmin = "natsadmin"

defaults

View Source
var NatsAlias string
View Source
var NatsCaroot = "" /* 1448-byte string literal not displayed */
View Source
var NatsClientcert = "" /* 1538-byte string literal not displayed */
View Source
var NatsClientkey = "" /* 1706-byte string literal not displayed */
View Source
var NatsMessages = make(map[int]MessageStore)
View Source
var NatsMessagesDevice = make(map[int]MessageStore)
View Source
var NatsMessagesIndex = make(map[string]bool)
View Source
var NatsMessagesIndexDevice = make(map[string]bool)
View Source
var NatsMsgMaxAge string
View Source
var NatsNodeUUID string
View Source
var NatsQueueDurable = "snatsdurable"
View Source
var NatsQueuePassword = "987654321098765432109876"
View Source
var NatsReceivingMessages bool
View Source
var NatsServer = "nats://nats.newhorizons3000.org:4222"
View Source
var NatsUser = "natsoperator"
View Source
var NatsUserAuthorizations = "natsauthorizations"
View Source
var NatsUserAuthorizationsPassword = "PASSWORD"
View Source
var NatsUserCommands = "natscommands"
View Source
var NatsUserCommandsPassword = "PASSWORD"
View Source
var NatsUserDevices = "natsdevices"
View Source
var NatsUserDevicesPassword = "PASSWORD"
View Source
var NatsUserEvents = "natsevents"
View Source
var NatsUserEventsPassword = "PASSWORD"
View Source
var NatsUserPassword = "hjscr44iod"
View Source
var PasswordHash string
View Source
var PreferedLanguage string
View Source
var Retro = 2
View Source
var RetroButton = color.RGBA{116, 207, 103, 250}
View Source
var RetroDisabled = color.RGBA{116, 207, 103, 64}
View Source
var RetroFocus = color.RGBA{116, 207, 103, 64}
View Source
var RetroHover = color.RGBA{116, 207, 103, 250}
View Source
var RetroHyperlink = color.RGBA{116, 207, 103, 1}
View Source
var RetroInputBackground = color.RGBA{116, 207, 103, 32}
View Source
var RetroInputBorder = color.RGBA{116, 207, 103, 250}
View Source
var RetroPlaceholder = color.RGBA{116, 207, 103, 255}
View Source
var RetroPressed = color.RGBA{116, 207, 103, 220}
View Source
var RetroPrimary = color.RGBA{116, 207, 103, 255}
View Source
var RetroScrollBar = color.RGBA{116, 207, 103, 250}
View Source
var RetroSelection = color.RGBA{116, 207, 103, 200}
View Source
var RetroSeparator = color.Black
View Source
var RetroShadow = color.RGBA{116, 207, 103, 64}
View Source
var ScheduleCategory int
View Source
var ScheduleStore = make(map[int]ScheduleStruct)
View Source
var Selected = 0
View Source
var SelectedCategory int
View Source
var SelectedDay int
View Source
var SelectedHour int
View Source
var SelectedInventory int

Functions

func CategoriesAdd

func CategoriesAdd(id string, desc string)

func CategoriesDelete

func CategoriesDelete(row int)

func CategoriesGet

func CategoriesGet()

func CategoriesToArray

func CategoriesToArray() []string

func CategoriesUpdate

func CategoriesUpdate(row int, id string, desc string)

func CategoriesWriteStub

func CategoriesWriteStub()

func CheckAUTHORIZATIONS

func CheckAUTHORIZATIONS(alias string) bool

func CheckDEVICE

func CheckDEVICE(alias string) bool

func ComparePasswords

func ComparePasswords(hashedPwd string, plainPwd []byte) bool

validate password

func DataStore

func DataStore(file string) fyne.URI

func DaysAdd

func DaysAdd(day string, desc string, dow int)

func DaysDelete

func DaysDelete(row int)

func DaysGet

func DaysGet()

func DaysUpdate

func DaysUpdate(row int, day string, desc string, dow int)

func Decrypt

func Decrypt(text string, secret string) string

decrypt string

func DecryptFile

func DecryptFile(filePathIn, filePathOut string) error

func DeleteBucket

func DeleteBucket(bucket, id string) error

func DeleteNatsMessage

func DeleteNatsMessage(seq uint64)

secure delete messages

func Edit

func Edit(action string, value string) bool

func Encrypt

func Encrypt(text string, secret string) string

encrypt string

func EncryptFile

func EncryptFile(filePathIn, filePathOut string) error

func EraseMessages

func EraseMessages(queue string)

func GetBucket

func GetBucket(bucket, id string) []byte

func GetBucketSize

func GetBucketSize(bucket, id string) uint64

func GetLangs

func GetLangs(c string) string

do translation

func HashAndSalt

func HashAndSalt(pwd []byte) string

hash and salt

func HoursAdd

func HoursAdd(id string, desc string)

func HoursDelete

func HoursDelete(row int)

func HoursGet

func HoursGet()

func HoursUpdate

func HoursUpdate(row int, id string, desc string)

func InventoryAdd

func InventoryAdd(category string, artist string, song string, album string, songlength int, rndorder string, startson string, expireson string, lastplayed string, dateadded string, spinstoday int, spinsweek int, spinstotal int, sourcelink string) int

func InventoryDelete

func InventoryDelete(row int)

func InventoryGet

func InventoryGet()

func InventoryUpdate

func InventoryUpdate(row int, category string, artist string, song string, album string, songlength int, rndorder string, startson string, expireson string, lastplayed string, dateadded string, spinstoday int, spinsweek int, spinstotal int, sourcelink string)

func LoadHashWithDefault

func LoadHashWithDefault(filename string, password string) (string, bool)

create and load hash

func ParseURL

func ParseURL(urlStr string) *url.URL

func PutBucket

func PutBucket(bucket string, id string, data []byte) int

func ReceiveDEVICE

func ReceiveDEVICE(alias string)

thread for receiving messages

func ReceiveMESSAGE

func ReceiveMESSAGE()

func SaveHash

func SaveHash(filename string, hash string) (string, bool)

save hash

func ScheduleAdd

func ScheduleAdd(days string, hours string, position string, categories string, spinstoplay int)

func ScheduleCopy

func ScheduleCopy(dayfrom, dayto string)

func ScheduleDelete

func ScheduleDelete(row int)

func ScheduleGet

func ScheduleGet()

func ScheduleUpdate

func ScheduleUpdate(row int, days string, hours string, position string, categories string, spinstoplay int)

func Send

func Send(subject, m, alias string) bool

send message to nats

func SendONAIR

func SendONAIR(subject, m string)

send message to nats

func SetupDetails

func SetupDetails(queue string, age string)

func SetupNATS

func SetupNATS()

Types

type CategoriesStruct

type CategoriesStruct struct {
	Row  int    // rowid
	Id   string // hours id
	Desc string // alias
}

type CommandStore

type CommandStore struct {
	CMDalias    string // alias
	CMDtype     int    // 1 = bash, 2 = bat. 3 = snmp
	CMDinterval string // how often
	CMDcommand  string // command to execute
	CMDexpected string // expected result from command
	CMDtimeout  int    // time to wait in seconds, 0 one ti,e

}

type DateTimePicker

type DateTimePicker struct {
	widget.BaseWidget

	OnActioned func(bool)
	// contains filtered or unexported fields
}

func NewDatePicker

func NewDatePicker(when time.Time, weekStart time.Weekday, fn func(time.Time, bool)) *DateTimePicker

func NewDateTimePicker

func NewDateTimePicker(when time.Time, weekStart time.Weekday, fn func(time.Time, bool)) *DateTimePicker

func (*DateTimePicker) CreateRenderer

func (dtp *DateTimePicker) CreateRenderer() fyne.WidgetRenderer

type DaysStruct

type DaysStruct struct {
	Row  int    // rowid
	Day  string // message id
	Desc string // alias
	Dow  int    // hostname
}

type DeviceStore

type DeviceStore struct {
	DSiduuid    string // message id
	DSalias     string // alias
	DShostname  string // hostname
	DSipadrs    string // ip address
	DSmacid     string // macids
	DSnodeuuid  string // unique id
	DSmessage   string // message payload
	DSdate      string // message date
	DSsubject   string // message subject
	DSos        string // device os
	DSsequence  uint64 // consumer sequence for secure delete
	DSelementid int    // order in array
}

type HoursStruct

type HoursStruct struct {
	Row  int    // rowid
	Id   string // hours id
	Desc string // alias
}

type InventoryStruct

type InventoryStruct struct {
	Row        int    // rowid
	Category   string // category
	Artist     string // artist
	Song       string // song
	Album      string // Album
	Songlength int    // song length
	Rndorder   string // assigned weekly
	Startson   string //
	Expireson  string
	Lastplayed string
	Dateadded  string
	Spinstoday int    // cleared daily at day reset
	Spinsweek  int    // spins weekly at week reset
	Spinstotal int    // total spins
	Sourcelink string // link to relevant source
}

type MessageStore

type MessageStore struct {
	MSiduuid    string // message id
	MSalias     string // alias
	MShostname  string // hostname
	MSipadrs    string // ip address
	MSmacid     string // macids
	MSmessage   string // message payload
	MSnodeuuid  string // unique id
	MSdate      string // message date
	MSsubject   string // message subject
	MSos        string // device os
	MSsequence  uint64 // consumer sequence for secure delete
	MSelementid int    // order in array
}

type MyTheme

type MyTheme struct{}

func (MyTheme) Color

func (m MyTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color

func (MyTheme) Font

func (m MyTheme) Font(style fyne.TextStyle) fyne.Resource

func (MyTheme) Icon

func (m MyTheme) Icon(name fyne.ThemeIconName) fyne.Resource

func (MyTheme) SetIcon

func (m MyTheme) SetIcon(name fyne.ThemeIconName, variant fyne.ThemeVariant)

func (MyTheme) Size

func (m MyTheme) Size(name fyne.ThemeSizeName) float32

type Natsjs

type Natsjs struct {
	NatsConnect *nats.Conn
	Js          jetstream.Stream

	Jetstream jetstream.JetStream

	Obsmp3 nats.ObjectStore
	Obsmp4 nats.ObjectStore
	Ctx    context.Context
	Ctxcan context.CancelFunc
}

func NewNatsJS

func NewNatsJS() (*Natsjs, error)

type NatsjsONAIR

type NatsjsONAIR struct {
	NatsConnectOA *nats.Conn
	JsOA          jetstream.Stream
	JetstreamOA   jetstream.JetStream
	CtxOA         context.Context
	CtxcanOA      context.CancelFunc
}

func NewNatsJSOnAir

func NewNatsJSOnAir() (*NatsjsONAIR, error)

type SQLconn

type SQLconn struct {
	Pool   pgxpool.Pool
	Ctx    context.Context
	Ctxcan context.CancelFunc
	// contains filtered or unexported fields
}

func NewPGSQL

func NewPGSQL() (*SQLconn, error)

type ScheduleStruct

type ScheduleStruct struct {
	Row         int    // rowid
	Days        string // days id
	Hours       string // hour part to play
	Position    string // position on schedule
	Category    string // category to play
	Spinstoplay int    // number of items to play
}

Jump to

Keyboard shortcuts

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