flags

package module
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: BSD-3-Clause Imports: 0 Imported by: 16

README

go-whosonfirst-flags

Go package defining interfaces for different classes of "flags" (or well-defined arguments) for querying or filtering Who's On First records.

Documentation

Go Reference

Important

Work in progress. Documentation is incomplete.

Documentation

Overview

package flags defines interfaces for different classes of "flags" (or well-defined arguments) for querying or filtering Who's On First records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlternateGeometryFlag added in v0.2.0

type AlternateGeometryFlag interface {
	// Return a boolean value indicating whether the flag matches any record in a set of AlternateGeometryFlag instances.
	MatchesAny(...AlternateGeometryFlag) bool
	// Return a boolean value indicating whether the flag matches all records in a set of AlternateGeometryFlag instances.
	MatchesAll(...AlternateGeometryFlag) bool
	IsAlternateGeometry() bool
	Label() string
	String() string
}

type CustomFlag added in v0.2.0

type CustomFlag interface {
	// Return a boolean value indicating whether the flag matches any record in a set of CustomFlag instances.
	MatchesAny(...CustomFlag) bool
	// Return a boolean value indicating whether the flag matches all records in a set of CustomFlag instances.
	MatchesAll(...CustomFlag) bool
	String() string
}

type CustomFlag provides a common interface for querying Who's On First records with non-standard (custom) flag types.

type DateFlag added in v0.3.0

type DateFlag interface {
	// Return a boolean value indicating whether the flag matches any record in a set of DateFlag instances.
	MatchesAll(...DateFlag) bool
	// Return a boolean value indicating whether the flag matches all records in a set of DateFlag instances.
	MatchesAny(...DateFlag) bool
	// Returns min, max numeric values representing to inner range of allowable dates for a DateFlag instance.
	InnerRange() (*int64, *int64)
	// Returns min, max numeric values representing to outer range of allowable dates for a DateFlag instance.
	OuterRange() (*int64, *int64)
	String() string
}

type DateFlags provides a common interface for querying Who's On First records using date ranges.

type ExistentialFlag

type ExistentialFlag interface {
	StringFlag() string
	Flag() int64
	// Return a boolean value indicating whether the flag is true.
	IsTrue() bool
	// Return a boolean value indicating whether the flag is false.
	IsFalse() bool
	// Return a boolean value indicating whether the flag is true or false (not -1).
	IsKnown() bool
	// Return a boolean value indicating whether the flag matches any record in a set of ExistentialFlag instances.
	MatchesAny(...ExistentialFlag) bool
	// Return a boolean value indicating whether the flag matches all records in a set of ExistentialFlag instances.
	MatchesAll(...ExistentialFlag) bool
	String() string
}

type ExistentialFlag provides a common interface for Who's On First -style "existential" flags where 1 represents true, 0 represents false and -1 represents unknown or to be determined.

type Float64RangeFlag added in v0.5.2

type Float64RangeFlag struct {
	RangeFlag
	// contains filtered or unexported fields
}

func (*Float64RangeFlag) MatchesAll added in v0.5.2

func (fl *Float64RangeFlag) MatchesAll(others ...RangeFlag) bool

func (*Float64RangeFlag) MatchesAny added in v0.5.2

func (fl *Float64RangeFlag) MatchesAny(others ...RangeFlag) bool

func (*Float64RangeFlag) Max added in v0.5.2

func (fl *Float64RangeFlag) Max() float64

func (*Float64RangeFlag) Min added in v0.5.2

func (fl *Float64RangeFlag) Min() float64

type PlacetypeFlag

type PlacetypeFlag interface {
	// Return a boolean value indicating whether the flag matches any record in a set of PlacetypeFlag instances.
	MatchesAny(...PlacetypeFlag) bool
	// Return a boolean value indicating whether the flag matches all records in a set of PlacetypeFlag instances.
	MatchesAll(...PlacetypeFlag) bool
	Placetype() string
	String() string
}

type PlaceFlag provides a common interface for querying Who's On First records using well-defined placetypes.

type RangeFlag added in v0.5.2

type RangeFlag interface {
	MatchesAny(...RangeFlag) bool
	MatchesAll(...RangeFlag) bool
	// Above(...RangeFlag) bool
	// Below(...RangeFlag) bool
	// Between(...RangeFlag) bool
	Min() float64
	Max() float64
}

func NewFloat64RangeFlag added in v0.5.2

func NewFloat64RangeFlag(min float64, max float64) RangeFlag

Directories

Path Synopsis
package custom defines non-specific custom flags for querying and filtering Who's On First records.
package custom defines non-specific custom flags for querying and filtering Who's On First records.
package date defines date-based flags for querying and filtering Who's On First records.
package date defines date-based flags for querying and filtering Who's On First records.
package existential defines "existential" flags for querying and filtering Who's On First records.
package existential defines "existential" flags for querying and filtering Who's On First records.
package geometry defines flags for querying and filtering Who's On First records by one or more geometry-related properties.
package geometry defines flags for querying and filtering Who's On First records by one or more geometry-related properties.
package placetypes defines flags for querying and filtering Who's On First records according to their placetype.
package placetypes defines flags for querying and filtering Who's On First records according to their placetype.

Jump to

Keyboard shortcuts

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