geconf

package
v0.0.0-...-4a8a5ab Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package geconf defines types for General/Global and per-Element Configuration. Includes marshaling to/from text.

"Element" here is intended to mean some kind of schema element (for example, a table in an SQL database) but may be generalized to mean the ability to specify configuration options for a part of a whole.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CanonicalOrder

type CanonicalOrder []Entry

CanonicalOrder = named type so we can implement sorting for a slice of configuration entries

func (CanonicalOrder) Len

func (cord CanonicalOrder) Len() int

func (CanonicalOrder) Less

func (cord CanonicalOrder) Less(i, j int) bool

func (CanonicalOrder) Swap

func (cord CanonicalOrder) Swap(i, j int)

type Entry

type Entry struct {
	ConfElement  string
	ConfProperty string
	ConfValue    string

	// A configuration entry's "rank" is intended for sorting only,
	// not to be stored or marshaled; should be set by the application
	// based on whatever rule is deemed useful.
	Rank int32
}

Entry = configuration entry (corresponds to a table row if using an SQL DB)

func (Entry) MarshalText

func (ce Entry) MarshalText() (text []byte, err error)

func (*Entry) UnmarshalText

func (ce *Entry) UnmarshalText(text []byte) error

type EntryTextError

type EntryTextError struct {
	BadEntry       Entry
	OffenderDescr  string
	FieldName      string
	BytePosInField int
}

func (*EntryTextError) Error

func (ete *EntryTextError) Error() string

type List

type List []Entry

List = named type so we can implement TextMarshaler and TextUnmarshaler for a slice of configuration entries

func (List) MarshalText

func (clist List) MarshalText() (text []byte, err error)

func (*List) UnmarshalText

func (clist *List) UnmarshalText(text []byte) error

type RankOrder

type RankOrder []Entry

RankOrder = named type so we can implement sorting by rank for a slice of configuration entries

func (RankOrder) Len

func (rord RankOrder) Len() int

func (RankOrder) Less

func (rord RankOrder) Less(i, j int) bool

func (RankOrder) Swap

func (rord RankOrder) Swap(i, j int)

Jump to

Keyboard shortcuts

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