Giter VIP home page Giter VIP logo

vl-go's Introduction

vl-go Build Status codecov GoDoc Go Report Card

vlgo is a Go HTTP client library around the VerifID identity verification layer API. It's a complete wrapper contains all endpoints available on Verification Layer. Use of this client and API is enough to verify someone's identity.

Features

  • VerifID vl REST API:
    • User
    • Image

Install

go get github.com/verifid/vl-go/vlgo

Usage

REST API

The vlgo package provides a Client for accessing the VerifID Verification Layer API. You need to follow 4 basic steps to verify a person and his identity.

Steps of user verification

  1. Send user's personal data
  2. Upload photos of identity card of passport
  3. Upload profile photo
  4. Call verify user

Here are some example requests.

import (
	"fmt"
	"net/http"
	"path"
	"time"

	"github.com/verifid/vl-go/vlgo"
)

var httpClient = &http.Client{
    Timeout: time.Second * 15,
}

// Send User Data
user := vlgo.User{
    Country:     "United States",
    DateOfBirth: "10.04.1980",
    Name:        "Tony",
    Surname:     "Stark"}

userClient := vlgo.NewUserService(httpClient)
userResponse, resp, err := userClient.User.SendUserData(user)
fmt.Println(userResponse)
fmt.Println(resp)
fmt.Println(err)

// Upload Identity Image
imageClient := vlgo.NewImageService(httpClient)

identityImagePath := path.Dir("/resources/2.png")
base64Str := imageClient.Image.ImageFileToBase64(identityImagePath)
imageUpload := vlgo.ImageUpload{Image: base64Str, UserID: "userId"}

uploadResponse, resp, err := imageClient.Image.UploadIdentity(imageUpload)
fmt.Println(uploadResponse)
fmt.Println(resp)
fmt.Println(err)

profileImagePath := path.Dir("/resources/2.png")
base64Str = imageClient.Image.ImageFileToBase64(profileImagePath)
imageUpload = vlgo.ImageUpload{Image: base64Str, UserID: "userId"}

// Upload Profile Image
uploadResponse, resp, err = imageClient.Image.UploadProfile(imageUpload)
fmt.Println(uploadResponse)
fmt.Println(resp)
fmt.Println(err)

// Verify User
verifyUser := vlgo.VerifyUser{
UserID:   "userId",
Language: "en_core_web_sm"}
userVerificationResponse, httResponse, err := userClient.User.VerifyUser(verifyUser)
fmt.Println(userVerificationResponse)
fmt.Println(httResponse)
fmt.Println(err)

vl-go's People

Contributors

abdullahselek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.