model

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReturnCategories

func ReturnCategories(au *AllItemsV2) []string

ReturnCategories needs an initialized AllItmsV2 struct to return a slice of strings of all unique categories

func ServSettingGetLang

func ServSettingGetLang() string

ServSettingGetLang returns a string of the langauge code saved in the server settings file

func ServSettingGetLogging

func ServSettingGetLogging() string

ServSettingGetLogging allows a simple interface that returns a string of the logging format specified.

func ServSettingGetRobots

func ServSettingGetRobots() string

ServSettingGetRobots returns the string of whichh method of robots file to use.

func ServSettingSetLang

func ServSettingSetLang(newLang string) (string, error)

ServSettingSetLang is made to modify the server settings language value only

func ServSettingSetLogging

func ServSettingSetLogging(newLogging string) (string, error)

ServSettingSetLogging takes a string of the new logging format and write it to the file, returning a string message of the action or error

func ServSettingSetRobots

func ServSettingSetRobots(newRobots string) (string, error)

ServSettingSetRobots can take a new robots value and save it to the serverSettings.json fiile.

Types

type AllItemsV2

type AllItemsV2 struct {
	Items []*ItemV2
}

AllItemsV2 a root struct of the array of JSON Item Models

func HomeV2

func HomeV2() (au *AllItemsV2)

HomeV2 will return all Data Items to allow templating on GoPage HomePage

type FullServSetting

type FullServSetting struct {
	ServerSettings *ServSetting
	ServerHostName string
	ServerOS       string
}

FullServSetting a struct to contain the standard ServSetting AND the hostname and OS

func FullServSettingGet

func FullServSettingGet() (au *FullServSetting)

FullServSettingGet a wrapper for the struct FullServSetting

type HTTPReqInfo

type HTTPReqInfo struct {
	Method    string
	URI       string
	Referer   string
	Ipaddr    string
	Code      int
	Size      int64
	Duration  time.Duration
	UserAgent string
	Protocol  string
}

HTTPReqInfo is used for the HTTP logging middleware as a simple struct to pack its logged info into for easy access

type ItemPluginsV2

type ItemPluginsV2 struct {
	Name     string `json:"name"`
	Options  string `json:"options"`
	Location string `json:"location"`
}

ItemPluginsV2 a struct dependency of ItemV2, for JSON Plugin Models

type ItemV2

type ItemV2 struct {
	ID           int              `json:"id"`
	FriendlyName string           `json:"friendlyName"`
	Link         string           `json:"link"`
	Category     string           `json:"category"`
	Colour       string           `json:"colour"`
	Style        string           `json:"style"`
	Plugins      []*ItemPluginsV2 `json:"plugins"`
}

ItemV2 a struct dependency of AllItemsV2 for JSON Item Models

func (ItemV2) NoBottomLeftPlugin

func (i ItemV2) NoBottomLeftPlugin() bool

NoBottomLeftPlugin a Method of the ItemV2 Struct to return a boolean if a plugin occupies the Bottom Left Space

func (ItemV2) NoBottomRightPlugin

func (i ItemV2) NoBottomRightPlugin() bool

NoBottomRightPlugin a Method of the ItemV2 Struct to return a boolean if a plugin occupies the Bottom Right Space

func (ItemV2) NoCenterPlugin

func (i ItemV2) NoCenterPlugin() bool

NoCenterPlugin a Method of the ItemV2 Struct to return a boolean if a plugin occupies the center space

func (ItemV2) NoTopLeftPlugin

func (i ItemV2) NoTopLeftPlugin() bool

NoTopLeftPlugin a Method of the ItemV2 Struct to return a boolean if a plugin occupies the Top Left Space

func (ItemV2) NoTopRightPlugin

func (i ItemV2) NoTopRightPlugin() bool

NoTopRightPlugin a Method of the ItemV2 Struct to return a Boolean if a plugin occupies the Top Right Space

type LinkHealthStruct

type LinkHealthStruct struct {
	Type          string
	Friendly      string
	FriendlyMatch string
	Item          string
}

LinkHealthStruct is the baseline struct for the matches of Link Health, dependent on LinkHealthStructSlice

type LinkHealthStructSlice

type LinkHealthStructSlice struct {
	Matches []LinkHealthStruct
}

LinkHealthStructSlice is the slice of LinkHealthStructs

func DetermineLinkHealth

func DetermineLinkHealth() LinkHealthStructSlice

DetermineLinkHealth is the function that returns the data portion of templating for LinkHealth.gohtml

func (*LinkHealthStructSlice) AddItem

AddItem is a method of LinkHealthStructSlice to add a new Item to the struct

func (LinkHealthStructSlice) HasNoItems

func (match LinkHealthStructSlice) HasNoItems() bool

HasNoItems is a method of LinkHealthStructSlice to determine if the slice is empty for templating ease

type PageTemplate

type PageTemplate struct {
	Title            string
	Theme            string
	CSS              []string
	JS               []string
	Data             interface{}
	TargetStrings    map[string]string
	DefaultStrings   map[string]string
	TargetLanguage   string
	HomePageCategory []string
}

PageTemplate is used to define the struct used to create each page

type ServSetting

type ServSetting struct {
	Name     string `json:"name"`
	Version  string `json:"version"`
	Author   string `json:"author"`
	Language string `json:"lang"`
	Logging  string `json:"logging"`
	Robots   string `json:"robots"`
}

ServSetting is a struct to contain the Server Settings or serverSettings.json data

func ServSettingGet

func ServSettingGet() (au *ServSetting)

ServSettingGet returns the item of Server Settings to allow templating

type UserSetting

type UserSetting struct {
	CustomBackground usrStgBck    `json:"customBackground"`
	HeaderPlugins    usrStgHdrPlg `json:"headerPlugins"`
}

UserSetting struct is made to contain the JSON of User settings

func UserSettingGet

func UserSettingGet() (au *UserSetting)

UserSettingGet is to access and return the user settings json

Jump to

Keyboard shortcuts

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