tokenex

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2016 License: MIT Imports: 4 Imported by: 0

README

tokenex-go CircleCI

A Go client for the TokenEx API.

TokenEx API Documentation

Token Services

Installation

$ go get github.com/cliffom/tokenex-go

Usage

tokenex.Initialize(
  "https://test-api.tokenex.com/TokenServices.svc/REST/",
  "YOUR_TOKENEX_ID",
  "YOUR_TOKENEX_API_KEY")
token, tokenErr := tokenex.Tokenize("4242424242424242", tokenex.SIXTOKENFOUR)
data, dataErr := tokenex.Detokenize(token.Token)
validate, validateErr  := tokenex.Validate(token.Token)
delete, deleteErr := tokenex.Delete(token.Token)

License

tokenex-go is available as open source under the terms of the MIT License.

Documentation

Index

Constants

View Source
const (
	SIXTOKENFOUR       = 1
	FOURTOKENFOUR      = 2
	TOKENFOUR          = 3
	GUID               = 4
	SSN                = 5
	NGUID              = 6
	NTOKENFOUR         = 7
	NTOKEN             = 8
	SIXANTOKENFOUR     = 9
	FOURANTOKENFOUR    = 10
	ANTOKENFOUR        = 11
	ANTOKEN            = 12
	ANTOKENAUTO        = 13
	ASCIITOKENFOUR     = 14
	ASCIITOKEN         = 15
	SIXASCIITOKENFOUR  = 16
	FOURASCIITOKENFOUR = 17
	ASCIITOKENAUTO     = 18
)

Variables

This section is empty.

Functions

func Initialize

func Initialize(baseUrl string, id string, apiKey string)

Types

type BaseResponse

type BaseResponse struct {
	Data            map[string]interface{}
	Error           string
	ReferenceNumber string
	Success         bool
}

type DeleteResponse

type DeleteResponse struct {
	BaseResponse
}

func Delete

func Delete(token string) (DeleteResponse, error)

type TokenResponse

type TokenResponse struct {
	BaseResponse
	Token string
}

func Tokenize

func Tokenize(data string, tokenScheme int) (TokenResponse, error)

func TokenizeFromEncryptedValue

func TokenizeFromEncryptedValue(data string, tokenScheme int) (TokenResponse, error)

type ValidateResponse

type ValidateResponse struct {
	BaseResponse
	Valid bool
}

func Validate

func Validate(token string) (ValidateResponse, error)

type ValueResponse

type ValueResponse struct {
	BaseResponse
	Value string
}

func Detokenize

func Detokenize(token string) (ValueResponse, error)

Jump to

Keyboard shortcuts

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