motd

package
v0.0.0-...-8dd1abf Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ExampleFile = "motd-example.json"
View Source
const TimeString = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalizedText

type LocalizedText struct {
	Lang string `json:"lang"`
	Str  string `json:"str"`
}

type Message

type Message struct {
	Begin    string          `json:"begin"`
	End      string          `json:"end"`
	Type     string          `json:"type"`
	Platform string          `json:"platform"`
	Urgency  string          `json:"urgency"`
	Text     []LocalizedText `json:"text"`
}

func FetchLatest

func FetchLatest() []Message

func (*Message) HasLocalizedText

func (m *Message) HasLocalizedText() bool

func (*Message) IsValid

func (m *Message) IsValid() bool

func (*Message) IsValidBegin

func (m *Message) IsValidBegin() bool

func (*Message) IsValidEnd

func (m *Message) IsValidEnd() bool

func (*Message) IsValidPlatform

func (m *Message) IsValidPlatform() bool

func (*Message) IsValidType

func (m *Message) IsValidType() bool

func (*Message) IsValidUrgency

func (m *Message) IsValidUrgency() bool

type Messages

type Messages struct {
	Messages []Message `json:"motd"`
}

func ParseFile

func ParseFile(f string) (Messages, error)

func (*Messages) Length

func (m *Messages) Length() int

Jump to

Keyboard shortcuts

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