config

package
v0.0.0-...-eb5d2db Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 41 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

Variables

View Source
var AdsMaxMinutes int
View Source
var AlbumArray []string
View Source
var CategoriesStore = make(map[int]CategoriesStruct)
View Source
var CategoryArray []string
View Source
var DBClientcert = "" /* 1096-byte string literal not displayed */
View Source
var DBClientkey = "" /* 1732-byte string literal not displayed */
View Source
var DBaddress = "192.168.88.232:5432/radio"

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 DarkScrollBarBackground = color.RGBA{187, 188, 201, 1}
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 FyneApp fyne.App
View Source
var FyneCategoryList fyne.Widget
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 FyneInventoryWin fyne.Window
View Source
var FyneMainWin fyne.Window
View Source
var FyneMessageList fyne.Widget
View Source
var FyneMessageWin fyne.Window
View Source
var FyneScheduleList fyne.Widget
View Source
var FyneUserList fyne.Widget
View Source
var HashLocation = "/home/oem/.config/fyne/org.nh3000.nh3000/config.hash"
View Source
var HoursStore = make(map[int]HoursStruct)
View Source
var InventoryStore = make(map[int]InventoryStruct)
View Source
var InventoryStoreCurrent = []InventoryStruct{}
View Source
var InventoryStoreRoots = []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, 1}
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 LightScrollBarBackground = color.RGBA{129, 137, 252, 1}
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

var fyneFilterFound = false

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

eng esp cmn

View Source
var NATS = &Natsjs{}
View Source
var NATSREPORT = &NatsjsREPORT{}
View Source
var NATSSTREAM = "NATS"
View Source
var NatsAdmin = "natsadmin"

defaults

View Source
var NatsAlias string
View Source
var NatsBucketType 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 NatsMessagesIndex = make(map[string]bool)
View Source
var NatsMessagesIndexDevice = make(map[string]bool)

var NatsMessagesDevice = make(map[int]MessageStore)

View Source
var NatsMsgMaxAge string
View Source
var NatsNodeUUID string
View Source
var NatsQueueDurable = "snatsdurable"
View Source
var NatsQueuePassword = "987654321098765432109876"
View Source
var NatsServer = "nats://192.168.88.232: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 NewNatsDone = false
View Source
var NewPGSlDone = false
View Source
var OAJSON = OA{}
View Source
var PasswordHash string
View Source
var PreferedLanguage string
View Source
var PreferencesLocation = "/home/oem/.config/fyne/org.nh3000.nh3000/preferences.json"
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, 1}
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 RetroScrollBarBackground = color.RGBA{116, 207, 103, 1}
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 SQL = &SQLconn{}

* The following fields need to be modified for your production * Environment to provide maximum security * * These fields are meant to be distributed at compile time and * editable in the gui. *

View Source
var ScheduleCategory int
View Source
var SchedulePlan = make(map[int]ScheduleStruct)
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
View Source
var SelectedUser int
View Source
var TimeZoneOffset = ""
View Source
var TrafficAlbum = ""
View Source
var TrafficEnd = "YYYY-MM-DD 23:59:59"
View Source
var TrafficStart = "YYYY-MM-DD 00:00:00"
View Source
var UserStore = make(map[int]UserStruct)
View Source
var WebAddress = "https://192.168.88.233:9000" // default web address

Functions

func AlbumToArray

func AlbumToArray() []string

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 CategoriesWhereUsed

func CategoriesWhereUsed(cat string) int

func CategoriesWriteStub

func CategoriesWriteStub(withinventory bool) string

func CheckBucket

func CheckBucket(bucket, id, station 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)

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, station string) []byte

func GetBucketSize

func GetBucketSize(bucket, id string) uint64

func GetDateTime

func GetDateTime(offsethours string) string

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, adstimeslots []string, adsdayslots []string, adsmaxspins int, adsmaxspinsperhour int, lastplayed string, dateadded string, spinstoday int, spinsweek int, spinstotal int, sourcelink string) int

func InventoryDelete

func InventoryDelete(row int)

func InventoryGet

func InventoryGet()

func InventoryGetCount

func InventoryGetCount(cat string) int

func InventoryGetCurrent

func InventoryGetCurrent()

func InventoryGetRoots

func InventoryGetRoots()

func InventoryGetRow

func InventoryGetRow(category, artist, song, album string) string

func InventoryGetRowByRow

func InventoryGetRowByRow(rowin string) string

func InventoryGetRowRecovery

func InventoryGetRowRecovery(artist, song, album string) string

func InventoryGetTrafficCount

func InventoryGetTrafficCount(artist, song, album string) map[string]int

func InventorySel

func InventorySel(cat, art string)

func InventoryUpdate

func InventoryUpdate(row int, category string, artist string, song string, album string, songlength int, rndorder string, startson string, expireson string, adstimeslots []string, adsdayslots []string, adsmaxspins int, adsmaxspinsperhour int, lastplayed string, dateadded string, spinstoday int, spinsweek int, spinstotal int, sourcelink string)

func InventoryUpdateRNDORDER

func InventoryUpdateRNDORDER()

func InventoryUpdateRecovery

func InventoryUpdateRecovery(row, songlength, startson, expireson string, adstimeslots string, adsdayslots string, adsmaxspins int, adsmaxspinsperhour int, lastplayed string, dateadded string, spinstoday int, spinsweek int, spinstotal int)

func LoadHashWithDefault

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

create and load hash

func NewNatsJS

func NewNatsJS() error

func NewPGSQL

func NewPGSQL() error

func PDFCategory

func PDFCategory(rn, stationid string)

func PDFCategoryByID

func PDFCategoryByID() []core.Row

func PDFDays

func PDFDays(rn, stationid string)

func PDFDaysByDay

func PDFDaysByDay() []core.Row

func PDFHours

func PDFHours(rn, stationid string)

func PDFHoursByHour

func PDFHoursByHour() []core.Row

func PDFInventory

func PDFInventory(rn, cat, stationid string)

func PDFInventoryByCategory

func PDFInventoryByCategory(cat string) []core.Row

func PDFOutput

func PDFOutput()

func PDFSchedule

func PDFSchedule(rn, stationid string)

func PDFScheduleByDay

func PDFScheduleByDay() []core.Row

func PDFTraffic

func PDFTraffic(rn, stationid string)

func PDFTrafficByAlbum

func PDFTrafficByAlbum() []core.Row

func PDFTrafficPageHeader

func PDFTrafficPageHeader(rn string) core.Row

func ParseURL

func ParseURL(urlStr string) *url.URL

func PutBucket

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

func ReceiveMESSAGE

func ReceiveMESSAGE()

func ReceiveONAIRMP3

func ReceiveONAIRMP3()

func ReceiveONAIRMP4

func ReceiveONAIRMP4()

func ReceiveONAIRWAV

func ReceiveONAIRWAV()

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, hourfrom, hourto string)

func ScheduleDelete

func ScheduleDelete(row int)

func ScheduleGet

func ScheduleGet()

func ScheduleGetCount

func ScheduleGetCount(cat string) int

func ScheduleGetPlan

func ScheduleGetPlan(day, hour, pos string)

func ScheduleSel

func ScheduleSel(day, hour string)

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

func SendONAIRmp3

func SendONAIRmp3(m string)

func SendONAIRmp4

func SendONAIRmp4(m string)

func SendONAIRwav

func SendONAIRwav(m string)

func SetupDetails

func SetupDetails(queue string, age string)

func SetupNATS

func SetupNATS()

func TestBucket

func TestBucket(bucket, id string) bool

func ToPDF

func ToPDF(reportname, stationid string)

func ToString

func ToString(s []string) string

func TrafficAdd

func TrafficAdd(category, artist, song, album, playedon string)

func TrafficCheckDuplicate

func TrafficCheckDuplicate(date, alb string) int

func TrafficClear

func TrafficClear() string

func TrafficGetAlbum

func TrafficGetAlbum(hours string) string

func TrafficGetCountByAlbum

func TrafficGetCountByAlbum(date, alb string) int

func TrafficGetCountByDate

func TrafficGetCountByDate(tc, td string) int

func UserAdd

func UserAdd(userrole, userpassword, userpasswordhash string, userauthcategories, userauthaction []string)

func UserDelete

func UserDelete(row int)

func UserGet

func UserGet()

func UserUpdate

func UserUpdate(row int, userrole, userpassword, userpasswordhash string, userauthcategories, userauthaction []string)

Types

type CategoriesStruct

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

type DaysStruct

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

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 //
	AdsTimeSlots       []string
	AdsDaySlots        []string
	AdsMaxSpins        int
	AdsMaxSpinsPerHour int
	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 ATS struct {
	Slot string // ads time slots 00-23
}

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
	Obswav   nats.ObjectStore
	OnAirmp3 jetstream.KeyValue
	OnAirmp4 jetstream.KeyValue
	OnAirwav jetstream.KeyValue
	Ctx      context.Context
	Ctxcan   context.CancelFunc
}

type NatsjsREPORT

type NatsjsREPORT struct {
	NatsConnectREPORT *nats.Conn
	JsREPORT          jetstream.Stream
	JetstreamREPORT   jetstream.JetStream
	CtxREPORT         context.Context
	CtxcanREPORT      context.CancelFunc
}

type OA

type OA struct {
	Artist              string
	Album               string
	Song                string
	Length              string
	SchedRow            string
	SchedDay            string
	SchedHour           string
	SchedPosition       string
	SchedCategory       string
	SchedSpinsToPlay    string
	SchedSpinsLefToPlay string
}

type SQLconn

type SQLconn struct {
	//conn   pgx.Conn
	Pool   pgxpool.Pool
	Ctx    context.Context
	Ctxcan context.CancelFunc
}

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
}

type UserStruct

type UserStruct struct {
	Row                int      // rowid
	Userrole           string   // role of user
	Userpassword       string   // Entered password
	Userpasswordhash   string   // Entered password
	Userauthcategories []string // authorized categories
	Userauthaction     []string // actions allowed
}

rowid serial primary key, userrole varchar(32), userpassword text not null, userpasswordhash varchar(128) not null, userauthcategories text array[128] not null, userauthactions text array[128] not null

func UserGetbyID

func UserGetbyID(id string) UserStruct

Jump to

Keyboard shortcuts

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