ulist

package
v0.0.0-...-14b48b0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Log = log15.New()
)

Functions

func ClusterCountry

func ClusterCountry(country string) string

func CompareUsernames

func CompareUsernames(u1, u2 string) bool

func Init

func Init(csvListPath string, ignoreUlistToml bool) error

func NormalizedCountry

func NormalizedCountry(country string) string

func SameCountry

func SameCountry(a, b string) bool

func SameRegion

func SameRegion(a, b string) bool

Types

type Address

type Address struct {
	Fullname string
	Street1  string
	Street2  string
	City     string
	State    string
	Country  string
	Zipcode  string
}

func (*Address) String

func (a *Address) String() string

type Ulist

type Ulist struct {
	// contains filtered or unexported fields
}

func GetAllUsers

func GetAllUsers() *Ulist

func NewUlist

func NewUlist(users []User) *Ulist

func (*Ulist) Filter

func (ul *Ulist) Filter(filterFn func(u User) bool) *Ulist

func (*Ulist) Get

func (ul *Ulist) Get(i int) *User

func (*Ulist) GetByCountry

func (ul *Ulist) GetByCountry(country string) *Ulist

func (*Ulist) GetByName

func (ul *Ulist) GetByName(name string) *User

func (*Ulist) Iter

func (ul *Ulist) Iter(iterFn func(i int, u User) error) error

func (*Ulist) Len

func (ul *Ulist) Len() int

func (*Ulist) Load

func (ul *Ulist) Load(fpath string) error

func (*Ulist) Save

func (ul *Ulist) Save(fpath string) error

type User

type User struct {
	Username       string
	ShareName      bool
	AgreeRules     bool
	RepSubreddit   string
	MessageToSanta string
	Watchlist      string
	Address        Address
	Regift         bool
	International  bool
	// contains filtered or unexported fields
}

User represents a participant in the ClosetSanta

func ParseFile

func ParseFile(fpath string) ([]User, error)

func (*User) GetMatch

func (u *User) GetMatch(ulist []User) *User

func (*User) String

func (u *User) String() string

Jump to

Keyboard shortcuts

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