api

package
v0.0.0-...-e5420c4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: GPL-3.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DatabaseFile string
View Source
var DefaultMailServices = MailServices{
	MailService{
		Name:           "Discord",
		UserExistsFunc: DiscordMail,
		Icon:           "./images/mail/discord.png",
	},
	MailService{
		Name:           "Spotify",
		UserExistsFunc: SpotifyMail,
		Icon:           "./images/mail/spotify.png",
	},
	MailService{
		Name:           "Twitter",
		UserExistsFunc: TwitterMail,
		Icon:           "./images/mail/twitter.png",
	},
	MailService{
		Name:           "Ubuntu GPG",
		UserExistsFunc: UbuntuGPGUserExists,
		Icon:           "./images/mail/ubuntu.png",
		Url:            "https://keyserver.ubuntu.com/pks/lookup?search={{ email }}&op=index",
	},
	MailService{
		Name:           "keys.gnupg.net",
		UserExistsFunc: KeysGnuPGUserExists,
		Icon:           "./images/mail/gnupg.ico",
		Url:            "https://keys.gnupg.net/pks/lookup?search={{ email }}&op=index",
	},
}
View Source
var DefaultServices = Services{
	Service{
		Name:           "GitHub",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    GithubInfo,
		BaseUrl:        "https://github.com/{username}",
	},
	Service{
		Name:           "TikTok",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://tiktok.com/@{username}",
	},
	Service{
		Name:           "Twitter",
		Check:          "pattern",
		Pattern:        "<div class=\"error-panel\"><span>User ",
		UserExistsFunc: AtUsernameUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://nitter.net/{username}",
		HtmlUrl:        "https://twitter.com/{username}",
	},
	Service{
		Name:           "Instagram",
		Check:          "",
		Pattern:        "Nothing found!",
		UserExistsFunc: InstagramUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://instagram.com/{username}",
	},
	Service{
		Name:           "LinkedIn",
		Check:          "",
		Pattern:        "{username}",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://linkedin.com/in/{username}",
	},
	Service{
		Name:           "Snapchat",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.snapchat.com/add/{username}",
	},
	Service{
		Name:           "Reddit",
		Check:          "",
		Pattern:        "Sorry, nobody on Reddit goes by that name.",
		BlockedPattern: "<title>Blocked</title>",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://reddit.com/user/{username}",
	},
	Service{
		Name:           "Facebook",
		Check:          "",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.facebook.com/{username}/videos",
		HtmlUrl:        "https://www.facebook.com/{username}",
	},
	Service{
		Name:           "Twitch",
		Check:          "",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.twitch.tv/{username}",
	},
	Service{
		Name:           "Chess.com",
		Check:          "",
		Pattern:        "The page you are looking for doesn’t exist. (404)",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://chess.com/member/{username}",
	},
	Service{
		Name:           "SteamGroup",
		Check:          "pattern",
		Pattern:        "No group could be retrieved for the given URL",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://steamcommunity.com/groups/{username}",
	},
	Service{
		Name:           "SteamCommunity",
		Check:          "pattern",
		Pattern:        "The specified profile could not be found.",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://steamcommunity.com/id/{username}",
	},
	Service{
		Name:           "TryHackMe",
		Check:          "status_code",
		UserExistsFunc: TryHackMeUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://tryhackme.com/p/{username}",
	},
	Service{
		Name:           "Odysee",
		Check:          "",
		Pattern:        "Channel Not Found",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://odysee.com/@{username}",
	},
	Service{
		Name:           "Scratch",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://scratch.mit.edu/users/{username}",
	},
	Service{
		Name:           "Telegram",
		Check:          "",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://t.me/{username}",
	},
	Service{
		Name:           "XBox Gamertag",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://xboxgamertag.com/search/{username}",
	},
	Service{
		Name:           "Spotify",
		Check:          "",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://spotify.com/user/{username}",
	},
	Service{
		Name:           "Mastodon.social",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://mastodon.social/{username}",
	},
	Service{
		Name:           "Mastodon.xyz",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://mastodon.xyz/{username}",
	},
	Service{
		Name:           "Npm",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://npmjs.com/~{username}",
	},
	Service{
		Name:           "Nintendolife",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.nintendolife.com/users/{username}",
	},
	Service{
		Name:           "VirusTotal",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.virustotal.com/ui/users/{username}/trusted_users",
	},
	{
		Name:           "Tellonym.me",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://tellonym.me/{username}",
	},
	Service{
		Name:           "gutefrage",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.gutefrage.net/nutzer/{username}",
	},
	Service{
		Name:           "Lichess",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    LichessInfo,
		BaseUrl:        "https://lichess.org/api/user/{username}",
	},
	Service{
		Name:           "SoundCloud",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://soundcloud.com/{username}",
	},
	Service{
		Name:           "repl.it",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://replit.com/{username}",
	},
	Service{
		Name:           "PyPi",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://pypi.org/user/{username}",
	},
	Service{
		Name:           "SlideShare",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://slideshare.net/{username}",
		AvatarUrl:      "https://cdn.slidesharecdn.com/profile-photo-{username}-96x96.jpg",
	},
	Service{
		Name:           "Fosstodon",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://fosstodon.org/@{username}",
	},
	Service{
		Name:           "Slides.com",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://slides.com/{username}",
	},
	Service{
		Name:           "Giphy",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://giphy.com/{username}",
	},
	Service{
		Name:           "Gravatar",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		ScrapeImage:    true,
		Scrape: ScrapeStruct{
			FindElement: ".photo-0",
			Attr:        "href",
		},
		BaseUrl: "http://en.gravatar.com/{username}",
	},
	Service{
		Name:              "LeetCode",
		Check:             "status_code",
		UserExistsFunc:    SimpleUserExistsCheck,
		GetInfoFunc:       SimpleAccountInfo,
		ExternalImageFunc: true,
		ImageFunc:         LeetCodeImage,
		BaseUrl:           "https://leetcode.com/{username}",
	},
	Service{
		Name:              "Asciinema",
		Check:             "status_code",
		UserExistsFunc:    SimpleUserExistsCheck,
		GetInfoFunc:       SimpleAccountInfo,
		ExternalImageFunc: true,
		ImageFunc:         AsciinemaImage,
		BaseUrl:           "https://asciinema.org/~{username}",
	},
	Service{
		Name:           "Ask Fedora",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://ask.fedoraproject.org/u/{username}",
	},
	Service{
		Name:           "Autofrage",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.autofrage.net/nutzer/{username}",
	},
	Service{
		Name:           "Finanzfrage",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.finanzfrage.net/nutzer/{username}",
	},
	Service{
		Name:           "Gesundheitsfrage",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.gesundheitsfrage.net/nutzer/{username}",
	},
	Service{
		Name:           "Linktree",
		Check:          "",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://linktr.ee/{username}",
	},
	Service{
		Name:           "Myspace",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://myspace.com/{username}",
	},
	Service{
		Name:           "Flickr",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.flickr.com/people/{username}",
	},
	Service{
		Name:           "FortniteTracker",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://fortnitetracker.com/profile/all/{username}",
	},
	Service{
		Name:           "Brave Community",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://community.brave.com/u/{username}",
	},
	Service{
		Name:           "BuyMeACoffee",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://buymeacoff.ee/{username}",
	},
	Service{
		Name:              "Bitbucket",
		Check:             "status_code",
		UserExistsFunc:    SimpleUserExistsCheck,
		GetInfoFunc:       SimpleAccountInfo,
		ExternalImageFunc: true,
		ImageFunc:         BitbucketImage,
		BaseUrl:           "https://bitbucket.org/{username}/",
	},
	Service{
		Name:           "Bitwarden",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://community.bitwarden.com/u/{username}/summary",
	},
	Service{
		Name:           "Cloudflare",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://community.cloudflare.com/u/{username}",
	},
	Service{
		Name:           "Clubhouse",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.clubhouse.com/@{username}",
	},
	Service{
		Name:           "Codepen",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://codepen.io/{username}",
	},
	Service{
		Name:           "Codewars",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://www.codewars.com/users/{username}",
	},
	Service{
		Name:           "Docker Hub",
		Check:          "",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://hub.docker.com/u/{username}",
	},
	Service{
		Name:           "Apple Developer",
		Check:          "status_code",
		UserExistsFunc: SimpleUserExistsCheck,
		GetInfoFunc:    SimpleAccountInfo,
		BaseUrl:        "https://developer.apple.com/forums/profile/{username}",
	},
}
View Source
var (
	ErrPersonNotFound = errortypes.APIError{
		Message: "Person Not Found",
		Status:  http.StatusNotFound,
	}
)
View Source
var RANDOM_PASSWORD = "64,iVBORw0KGgoAAAA$1"
View Source
var RANDOM_USERNAME = "AAAANSUhEUgAAAgAAAA"

Functions

func AsciinemaImage

func AsciinemaImage(username string, service Service) string

func AtUsernameUserExistsCheck

func AtUsernameUserExistsCheck(service Service, username string, config ApiConfig) (error, bool)

func BitbucketImage

func BitbucketImage(username string, service Service) string

func Check

func Check(err error)

func CheckAndLog

func CheckAndLog(err error, msg string, config ApiConfig)

func CheckPersonExists

func CheckPersonExists(config ApiConfig, id string) bool

func ConvertToGrayscale

func ConvertToGrayscale(img image.Image) image.Image

ConvertToGrayscale converts an image to grayscale

func DHash

func DHash(img image.Image) (hash uint64)

DHash calculates the dHash of an image

func DefaultSaveDB

func DefaultSaveDB(config ApiConfig) error

func DeleteAccount

func DeleteAccount(config ApiConfig, c *gin.Context)

func DeletePerson

func DeletePerson(config ApiConfig, c *gin.Context)

func DetectLanguage

func DetectLanguage(apiConfig ApiConfig, c *gin.Context)

func DetectLanguageCode

func DetectLanguageCode(apiConfig ApiConfig, c *gin.Context)

func Emails

func Emails(email string)

func EncodeBase64

func EncodeBase64(img string) string

func GetAccountsRequest

func GetAccountsRequest(config ApiConfig, c *gin.Context)

func GetConfig

func GetConfig(apiConfig ApiConfig, c *gin.Context)

func GetDataBase

func GetDataBase(config ApiConfig, c *gin.Context)

func GetInfo

func GetInfo(apiConfig ApiConfig, c *gin.Context)

func GetPersonByIDRequest

func GetPersonByIDRequest(config ApiConfig, c *gin.Context)

func GetStatusCode

func GetStatusCode(url string) int

func GetStatusCodeNew

func GetStatusCodeNew(url string, config ApiConfig) (error, int)

func GithubInfoDeepRequest

func GithubInfoDeepRequest(config ApiConfig, c *gin.Context)

func GoogleRequest

func GoogleRequest(config ApiConfig, c *gin.Context)

func Handler

func Handler(function func(ApiConfig, *gin.Context), config ApiConfig) gin.HandlerFunc

func HttpRequest

func HttpRequest(url string) (string, error)

func InstagramUserExistsCheck

func InstagramUserExistsCheck(service Service, username string, config ApiConfig) (error, bool)

func IsGitHubMail

func IsGitHubMail(email string) bool

func KeyserverPGPUserExists

func KeyserverPGPUserExists(service MailService, email string, config ApiConfig) (error, bool)

func LeetCodeImage

func LeetCodeImage(username string, service Service) string

func MarkdownPersonRequest

func MarkdownPersonRequest(config ApiConfig, c *gin.Context)

func MkImgHash

func MkImgHash(img image.Image) uint64

func NormalizeImage

func NormalizeImage(img image.Image, width, height int) image.Image

func Openbrowser

func Openbrowser(url string)

func PgpMitUserExists

func PgpMitUserExists(service MailService, email string, config ApiConfig) (error, bool)

func PointerHandler

func PointerHandler(function func(*ApiConfig, *gin.Context), apiConfig *ApiConfig) gin.HandlerFunc

func PoolSKSUserExists

func PoolSKSUserExists(service MailService, email string, config ApiConfig) (error, bool)

func PortScan

func PortScan(ip string) map[int]bool

func PostConfig

func PostConfig(apiConfig ApiConfig, c *gin.Context)

func PostPerson

func PostPerson(config ApiConfig, c *gin.Context)

THIS HAS NO C.PARAM("id") THIS IS THE WORST PEICE OF BAD CODE I EVER WROTE

func RandomChar

func RandomChar() string

func RandomString

func RandomString(cnt int) string

func RestartBin

func RestartBin(apiConfig ApiConfig, c *gin.Context)

func SaveWayback

func SaveWayback(config ApiConfig, c *gin.Context)

func ScanAccounts

func ScanAccounts(config ApiConfig, username string) services.ServiceCheckResults

func ScanAccountsRequest

func ScanAccountsRequest(config ApiConfig, c *gin.Context)

func Scrape

func Scrape(url string)

func ServeApi

func ServeApi(config ApiConfig)

func SetupLogger

func SetupLogger(config ApiConfig)

func SimpleUserExistsCheck

func SimpleUserExistsCheck(service Service, username string, config ApiConfig) (error, bool)

func TestApi

func TestApi(dataBase DataBase)

func TryHackMeUserExistsCheck

func TryHackMeUserExistsCheck(service Service, username string, config ApiConfig) (error, bool)

func UrlTemplate

func UrlTemplate(url string, username string) string

func Whois

func Whois(url string, config ApiConfig) string

func WhoisRequest

func WhoisRequest(config ApiConfig, c *gin.Context)

Types

type Account

type Account struct {
	Service   string   `json:"service"`  // example: GitHub
	Id        string   `json:"id"`       // example: 1224234
	Username  string   `json:"username"` // example: 9glenda
	Url       string   `json:"url"`      // example: https://github.com/9glenda
	Picture   Pictures `json:"profilePicture"`
	Bio       Bios     `json:"bio"`       // example: pro hacka
	Firstname string   `json:"firstname"` // example: Glenda
	Lastname  string   `json:"lastname"`  // example: Belov
	Location  string   `json:"location"`  // example: Moscow
	Created   string   `json:"created"`   // example: 2020-07-31T13:04:48Z
	Updated   string   `json:"updated"`
	Blog      string   `json:"blog"`
	Followers int      `json:"followers"`
	Following int      `json:"following"`
}

func EmptyAccountInfo

func EmptyAccountInfo(username string, service Service) Account

func GetAvatar

func GetAvatar(avatar_url string, account Account, config ApiConfig) (error, Account)

func GithubInfo

func GithubInfo(username string, service Service, config ApiConfig) (error, Account)

func LichessInfo

func LichessInfo(username string, service Service, config ApiConfig) (error, Account)

func SimpleAccountInfo

func SimpleAccountInfo(username string, service Service, config ApiConfig) (error, Account)

func SlideshareInfo

func SlideshareInfo(username string, service Service, config ApiConfig) (error, Account)

type Accounts

type Accounts map[string]Account

type Accounts map[string]Account

func GetAccounts

func GetAccounts(config ApiConfig, username string) Accounts

func ServicesHandler

func ServicesHandler(servicesToCheck Services, username string, config ApiConfig) Accounts

type Age

type Age float64

func (Age) IsValid

func (age Age) IsValid() bool

func (Age) Markdown

func (age Age) Markdown() string

type ApiConfig

type ApiConfig struct {
	Version        version.SchematicVersion `json:"version"`
	Config         config.Config            `json:"config"`
	Server         server.Server            `json:"server"`
	LogFile        string                   `json:"log_file"`
	DataBaseFile   string                   `json:"data_base_file"`
	DataBase       DataBase                 `json:"data_base"`
	SetCORSHeader  bool                     `json:"set_CORS_header"`
	SaveDBFunc     SaveDBFunc               `json:"save_db_func"`
	LoadDBFunc     LoadDBFunc               `json:"load_db_func"`
	GinRouter      *gin.Engine              `json:"gin_router"`
	ApiKeysComplex ApiKeys                  `json:"api_keys_complex"`
	ApiKeysSimple  ApiKeysSimple            `json:"api_keys"`
	Testing        bool                     `json:"testing"`
	BadgerDBLogger badger.Logger            `json:"badger_db_logger"`
	Parsers        []func(ApiConfig) (ApiConfig, error)
}

func DefaultLoadDB

func DefaultLoadDB(config ApiConfig) (ApiConfig, error)

func (ApiConfig) ConfigParse

func (config ApiConfig) ConfigParse() (ApiConfig, error)

func (ApiConfig) GetPerson

func (config ApiConfig) GetPerson(id string) (Person, error)

func (ApiConfig) LoadDB

func (config ApiConfig) LoadDB() (ApiConfig, error)

func (*ApiConfig) LoadDBPointer

func (config *ApiConfig) LoadDBPointer() error

func (ApiConfig) Parse

func (config ApiConfig) Parse() (ApiConfig, error)

func (*ApiConfig) ParsePointer

func (config *ApiConfig) ParsePointer() error

func (ApiConfig) SaveDB

func (config ApiConfig) SaveDB() error

func (ApiConfig) ServeTempMail

func (config ApiConfig) ServeTempMail()

func (ApiConfig) SetupWebServer

func (config ApiConfig) SetupWebServer()

func (ApiConfig) Validate

func (config ApiConfig) Validate() error

type ApiKey

type ApiKey struct {
}

type ApiKeyEnum

type ApiKeyEnum map[string]ApiKey

type ApiKeys

type ApiKeys struct {
	Github ApiKeyEnum `json:"github"`
}

type ApiKeysSimple

type ApiKeysSimple map[string][]string // map["serviceName"]["key1","key2"]

type Bio

type Bio struct {
	Bio string `json:"bio"`
}

type Bios

type Bios map[string]Bio

type DataBase

type DataBase map[string]Person

func (DataBase) Parse

func (dataBase DataBase) Parse(config ApiConfig) (DataBase, error)

type Email

type Email struct {
	Mail            string          `json:"mail"`
	Value           int             `json:"value"`
	Src             string          `json:"src"`
	Services        EmailServices   `json:"services"`
	SkippedServices SkippedServices `json:"skipped_services"`
	Valid           bool            `json:"valid"`
	Provider        string          `json:"provider"`
}

func (Email) CheckMail

func (email Email) CheckMail(config ApiConfig) (Email, error)

func (Email) GetExistingEmailServices

func (email Email) GetExistingEmailServices(mailServices MailServices, apiConfig ApiConfig) (EmailServices, SkippedServices, error)

func (Email) IsGmailAddress

func (e Email) IsGmailAddress() bool

Methods

func (Email) IsValidEmail

func (e Email) IsValidEmail() bool

func (Email) IsValidGmailAddress

func (e Email) IsValidGmailAddress() bool

func (Email) Markdown

func (e Email) Markdown() string

func (Email) Parse

func (e Email) Parse() Email

type EmailService

type EmailService struct {
	Name     string `json:"name"`
	Link     string `json:"link"`
	Username string `json:"username"`
	Icon     string `json:"icon"`
}

func DiscordMail

func DiscordMail(mailService MailService, email string, config ApiConfig) (EmailService, error)

func KeysGnuPGUserExists

func KeysGnuPGUserExists(mailService MailService, email string, config ApiConfig) (EmailService, error)

func SpotifyMail

func SpotifyMail(mailService MailService, email string, config ApiConfig) (EmailService, error)

func TwitterMail

func TwitterMail(mailService MailService, email string, config ApiConfig) (EmailService, error)

func UbuntuGPGUserExists

func UbuntuGPGUserExists(mailService MailService, email string, config ApiConfig) (EmailService, error)

func (EmailService) Markdown

func (s EmailService) Markdown(name string) string

func (EmailService) Merge

func (emailService1 EmailService) Merge(emailService2 EmailService) (EmailService, error)

type EmailServices

type EmailServices map[string]EmailService

func (EmailServices) Markdown

func (es EmailServices) Markdown() string

func (EmailServices) Merge

func (ess1 EmailServices) Merge(ess2 EmailServices) (EmailServices, error)

type EmailsType

type EmailsType map[string]Email

Types

func (EmailsType) CheckMail

func (emails EmailsType) CheckMail(config ApiConfig) (EmailsType, error)

func (EmailsType) Markdown

func (et EmailsType) Markdown() string

func (EmailsType) Parse

func (emailAdresses EmailsType) Parse() EmailsType

func (EmailsType) Validate

func (emailAdresses EmailsType) Validate() error

type GetInfoFunc

type GetInfoFunc func(string, Service, ApiConfig) (error, Account) // (username)

type ImageFunc

type ImageFunc func(string, Service) string // (username)

type LoadDBFunc

type LoadDBFunc func(ApiConfig) (ApiConfig, error)

type MailService

type MailService struct {
	Name           string             // example: "Discord"
	UserExistsFunc MailUserExistsFunc // example: Discord(MailService,string,ApiConfig) (EmailService,error)
	Icon           string             // example: "./images/mail/discord.png"
	Url            string
}

type MailServices

type MailServices []MailService

type MailUserExistsFunc

type MailUserExistsFunc func(MailService, string, ApiConfig) (EmailService, error)

type Person

type Person struct {
	ID             string                         `json:"id" ts_transform:"__VALUE__ || ''"`
	Name           string                         `json:"name" ts_transform:"__VALUE__ || ''"`
	Gender         gender.Gender                  `json:"gender" ts_transform:"__VALUE__ || ''"`
	Ethnicity      ethnicity.Ethnicity            `json:"ethnicity" ts_transform:"__VALUE__ || ''"`
	Pictures       Pictures                       `json:"pictures"`
	Maidenname     string                         `json:"maidenname" ts_transform:"__VALUE__ || ''"`
	Age            Age                            `json:"age" ts_transform:"__VALUE__ || 0` // has to be a float64 becuase of json Unmarshal
	Birthday       string                         `json:"bday" ts_transform:"__VALUE__ || ''"`
	Address        string                         `json:"address" ts_transform:"__VALUE__ || ''"`
	Phone          PhoneNumbers                   `json:"phone"`
	Ips            ip.Ips                         `json:"ips"`
	Civilstatus    civilstatus.CivilStatus        `json:"civilstatus" ts_transform:"__VALUE__ || ''"`
	Kids           string                         `json:"kids" ts_transform:"__VALUE__ || ''"`
	Hobbies        hobby.Hobbies                  `json:"hobbies"`
	Email          EmailsType                     `json:"email"`
	Occupation     string                         `json:"occupation" ts_transform:"__VALUE__ || ''"`
	Prevoccupation string                         `json:"prevoccupation" ts_transform:"__VALUE__ || ''"`
	Education      string                         `json:"education" ts_transform:"__VALUE__ || ''"`
	Military       string                         `json:"military" ts_transform:"__VALUE__ || ''"`
	Religion       religion.Religion              `json:"religion" ts_transform:"__VALUE__ || ''"`
	Pets           string                         `json:"pets" ts_transform:"__VALUE__ || ''"`
	Clubs          club.Clubs                     `json:"clubs"`
	Legal          string                         `json:"legal" ts_transform:"__VALUE__ || ''"`
	Political      string                         `json:"political" ts_transform:"__VALUE__ || ''"`
	Notes          string                         `json:"notes" ts_transform:"__VALUE__ || ''"`
	Relations      Relation                       `json:"relations"` // FIXME
	Sources        sources.Sources                `json:"sources"`
	Accounts       Accounts                       `json:"-"`
	Services       services.MapServiceCheckResult `json:"accounts"`
	Tags           Tags                           `json:"tags"`
	NotAccounts    map[string]Account             `json:"notaccounts"`
	Custom         interface{}                    `json:"custom"`
}

main data set

func GetPersonByID

func GetPersonByID(config ApiConfig, id string) (bool, Person)

func (Person) CheckMail

func (person Person) CheckMail(config ApiConfig) (Person, error)

func (emails EmailsType) CheckMail(config ApiConfig) (EmailsType, error) { // FIXME slow

	var err error
	for _, email := range functions.SortMapKeys(emails) {
		emails[email], err = emails[email].CheckMail(config)
	}
	return emails, err
}

func (Person) Markdown

func (person Person) Markdown() string

func (Person) Parse

func (person Person) Parse(config ApiConfig) (Person, error)

func (Person) ReplaceNil

func (person Person) ReplaceNil() Person

func (Person) Validate

func (person Person) Validate() error

type PhoneNumber

type PhoneNumber struct {
	Number         string        `json:"number"`
	Valid          bool          `json:"valid"`
	NationalFormat string        `json:"national_format"`
	Tag            string        `json:"tag"`
	Phoneinfoga    number.Number `json:"phoneinfoga"`
}

func (PhoneNumber) GetPhoneinfoga

func (phoneNumber PhoneNumber) GetPhoneinfoga() (number.Number, error)

func (PhoneNumber) IsValid

func (phoneNumber PhoneNumber) IsValid() bool

func (PhoneNumber) Markdown

func (phoneNumber PhoneNumber) Markdown() string

Markdown

func (PhoneNumber) Parse

func (phoneNumber PhoneNumber) Parse() (PhoneNumber, error)

type PhoneNumbers

type PhoneNumbers map[string]PhoneNumber

func (PhoneNumbers) Markdown

func (numbers PhoneNumbers) Markdown() string

func (PhoneNumbers) Parse

func (numbers PhoneNumbers) Parse() (PhoneNumbers, error)

func (PhoneNumbers) Validate

func (numbers PhoneNumbers) Validate() error

type Picture

type Picture struct {
	Img     string `json:"img"`
	ImgHash uint64 `json:"img_hash"`
}

type Pictures

type Pictures map[string]Picture

type Relation

type Relation map[string][]string

type SaveDBFunc

type SaveDBFunc func(ApiConfig) error

type ScrapeStruct

type ScrapeStruct struct {
	FindElement string
	Attr        string
}
type Search struct {
	Url         string `json:"url"`
	Description string `json:"description"`
	Title       string `json:"title"`
}

type Searches

type Searches []Search

func SearchString

func SearchString(query string) Searches

type Service

type Service struct {
	Name              string         // example: "GitHub"
	UserExistsFunc    UserExistsFunc // example: SimpleUserExistsCheck()
	GetInfoFunc       GetInfoFunc    // example: EmptyAccountInfo()
	ImageFunc         ImageFunc
	ExternalImageFunc bool
	ScrapeImage       bool
	Scrape            ScrapeStruct
	BaseUrl           string // example: "https://github.com"
	AvatarUrl         string
	Check             string // example: "status_code"
	HtmlUrl           string
	Pattern           string
	BlockedPattern    string
}

type Services

type Services []Service

type SkippedServices

type SkippedServices map[string]bool

func (SkippedServices) Markdown

func (ss SkippedServices) Markdown() string

type Tag

type Tag struct {
	Name string `json:"name"`
}

type Tags

type Tags []Tag

type UserExistsFunc

type UserExistsFunc func(Service, string, ApiConfig) (error, bool) // (service,username)

Jump to

Keyboard shortcuts

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