mapq

package
v0.0.0-...-0dfd57a Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mapq provides aggregation and filtering functions for generic maps

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Matches

func Matches(a interface{}, op string, b interface{}) bool

Types

type Collection

type Collection []map[string]interface{}

func ToCollection

func ToCollection(v interface{}) Collection

func (Collection) Aggregate

func (c Collection) Aggregate(key string, op string) float64

func (Collection) All

func (c Collection) All(filter Filter) bool

func (Collection) Any

func (c Collection) Any(filter Filter) bool

func (Collection) Each

func (c Collection) Each(f func(m M) M) Collection

func (Collection) Filter

func (c Collection) Filter(filter Filter) Collection

func (Collection) GroupBy

func (c Collection) GroupBy(key string) Group

func (Collection) OrderBy

func (c Collection) OrderBy(key string, order string) Collection

func (Collection) Slice

func (c Collection) Slice() []map[string]interface{}

type Filter

type Filter map[string]interface{}

type Group

type Group map[string][]map[string]interface{}

func (Group) Aggregate

func (g Group) Aggregate(key, op string) M

func (Group) Each

func (g Group) Each(f func(c Collection) Collection) Group

func (Group) M

func (g Group) M() M

func (Group) Map

func (g Group) Map() map[string]interface{}

type M

type M map[string]interface{}

func (M) Map

func (m M) Map() map[string]interface{}

func (M) Matches

func (m M) Matches(filter Filter) bool

Jump to

Keyboard shortcuts

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