namecheck

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 3 Imported by: 0

README

Namecheck

Namecheck logo

Docs Go Report Card Github GitLab Froggit License FOSSA Status Maintenance Twitter

Security Rating Vulnerabilities

Overview

A simple CLI and server to check a name availability on Twitter and GitHub.

How to use it

If you have already Docker installed on your laptop

docker run davidaparicio/namecheck:<TAG/VERSION_LIKE_v0.0.5> <PSEUDO_TO_CHECK>

If not, you need Go and all dependencies

go run cmd/cli/main.go <PSEUDO_TO_CHECK>

or the server with

go run cmd/server/main.go

and check with a curl command curl http://localhost:8080/check?username=<PSEUDO_TO_CHECK>

For more information, you can see examples here

Remarks

Twitter checker is using a GCP Cloud Function, adding a network latency simulation, configurable through a parameter.

Server handles timeouts as recommended Filippo Valsorda on the Cloudflare blog (post 1 / post 2) and Ilija Eftimov.

ADR (Architecture decision record) about the usage of gorilla/mux can be found here.

Contribute

Works on my machine - and yours ! Spin up pre-configured, standardized dev environments of this repository, by clicking on the button below.

Open in Gitpod

Original project

Fork of the opensource project by @jub0bs, available on GitHub at https://github.com/jub0bs/namecheck.

License

Licensed under the MIT License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License here.

If needed some help, there are a "Licenses 101" by FOSSA, a Snyk explanation of MIT license and a French conference talk by Jean-Michael Legait about licenses.

FOSSA Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Availabler

type Availabler interface {
	IsAvailable(ctx context.Context, username string) (bool, error)
}

type Checker

type Checker interface {
	Validator
	Availabler
	fmt.Stringer
}

type Client

type Client interface {
	Do(req *http.Request) (*http.Response, error)
}

type UnknownAvailabilityError

type UnknownAvailabilityError struct {
	Username string
	Platform string
	Cause    error
}

func (*UnknownAvailabilityError) Error

func (e *UnknownAvailabilityError) Error() string

func (*UnknownAvailabilityError) Unwrap

func (e *UnknownAvailabilityError) Unwrap() error

type Validator

type Validator interface {
	IsValid(username string) bool
}

Directories

Path Synopsis
cmd
cli command
server command
Package github provides primitives to check if an username is available on Github.
Package github provides primitives to check if an username is available on Github.
Package twitter provides primitives to check if an username is available on Twitter.
Package twitter provides primitives to check if an username is available on Twitter.

Jump to

Keyboard shortcuts

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