collections

package
v0.0.0-...-b631e0d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OldVersion

func OldVersion(v int) func(w WorkWith) bool

OldVersion returns a closures that validates the version is greater than the specified amount

Types

type WorkWith

type WorkWith struct {
	Data    string
	Version int
}

WorkWith is the struct we'll be implementing collections for

func Filter

func Filter(ws []WorkWith, f func(w WorkWith) bool) []WorkWith

Filter is a functional filter. It takes a list of WorkWith and a WorkWith Function that returns a bool for each "true" element we return it to the resultant list

func IncrementVersion

func IncrementVersion(w WorkWith) WorkWith

IncrementVersion increments a WorkWiths Version

func LowerCaseData

func LowerCaseData(w WorkWith) WorkWith

LowerCaseData does a ToLower to the Data string of a WorkWith

func Map

func Map(ws []WorkWith, f func(w WorkWith) WorkWith) []WorkWith

Map is a functional map. It takes a list of WorkWith and a WorkWith Function that takes a WorkWith and returns a modified WorkWith. The end result is a list of modified WorkWiths

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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