gofps

package module
v0.0.0-...-ae1fa0b Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 7 Imported by: 0

README

gofps - Golang FastPeopleSearch Wrapper

Why?

Almost every single library for people searching is paid and charges a ridiculous fee. This wrapper is free and open source.

Usage

package main

import(
	"fmt"
	"github.com/TAJ4K/gofps"
)

func main() {
    people, err := gofps.Search("John Smith", "", "NY")
    if err != nil {
        fmt.Println(err)
    }

    boomers := people.SearchPeopleByAgegroup(gofps.AgeGroupBoomers)
    for _, person := range boomers.People {
        fmt.Println(person.Addresses.Current)
    }
}

Documentation

Overview

Copyright 2022 TAJ4K

Index

Constants

This section is empty.

Variables

View Source
var (
	AgeGroupYoung  = AgeGroup{Min: 18, Max: 28}
	AgeGroupMiddle = AgeGroup{Min: 28, Max: 45}
	AgeGroupOld    = AgeGroup{Min: 45, Max: 100}
)

Age Group estimates are provided to help narrow down the search results.

View Source
var (
	AgeGroupGenZ       = AgeGroup{Min: 18, Max: 25}
	AgeGroupMillenials = AgeGroup{Min: 25, Max: 41}
	AgeGroupGenX       = AgeGroup{Min: 41, Max: 57}
	AgeGroupBoomers    = AgeGroup{Min: 57, Max: 76}
	AgeGroupSilent     = AgeGroup{Min: 76, Max: 100}
)

Generations are also provided, incase it helps more.

Functions

This section is empty.

Types

type AgeGroup

type AgeGroup struct {
	Min int64
	Max int64
}

AgeGroup is a struct that contains the min and max age of a group of people used for sorting struct People You can create your own instead of using premades by `gofps.AgeGroup{Min: 0, Max: 100}`

type People

type People struct {
	People []Person
}

People is a collection of Person objects that gets returned from the search function and all sorts

func Search(name, city, state string) (People, error)

Search takes a name, city, and state then returns a People object. City is optional, but state isn't.

func (People) ConvertToJson

func (people People) ConvertToJson() (string, error)

Converts People struct to JSON

func (People) SearchPeopleByAge

func (people People) SearchPeopleByAge(givenAge int64) People

Takes in a specific Age and returns all people that match

func (People) SearchPeopleByAgeGroup

func (people People) SearchPeopleByAgeGroup(ageGroup AgeGroup) People

Takes in a AgeGroup to filter a People object

type Person

type Person struct {
	Name   string
	GoesBy string
	Age    string

	Addresses struct {
		Current string
		Past    []string
	}

	Phones struct {
		Current string
		Past    []string
	}

	Relatives []string
}

Person contains all the information of a single person that is publically available.

func (Person) ConvertToJson

func (person Person) ConvertToJson() (string, error)

Converts Person struct to JSON

Jump to

Keyboard shortcuts

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