Go
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/securitytextorgapi_lib
.project
LICENSE
README.md

README.md

Getting started

An API for securitytext.org

How to Build

  • In order to successfully build and run your SDK files, you are required to have the following setup in your system:
  • Ensure that GOPATH environment variable is set in the system variables. If not, set it to your workspace directory where you will be adding your Go projects.
  • The generated code uses unirest-go http library. Therefore, you will need internet access to resolve this dependency. If Go is properly installed and configured, run the following command to pull the dependency:
go get github.com/apimatic/unirest-go

This will install unirest-go in the GOPATH you specified in the system variables.

Now follow the steps mentioned below to build your SDK:

  1. Open eclipse in the Go language perspective and click on the Import option in File menu.

Importing SDK into Eclipse - Step 1

  1. Select General -> Existing Projects into Workspace option from the tree list.

Importing SDK into Eclipse - Step 2

  1. In Select root directory, provide path to the unzipped archive for the generated code. Once the path is set and the Project becomes visible under Projects click Finish

Importing SDK into Eclipse - Step 3

  1. The Go library will be imported and its files will be visible in the Project Explorer

Importing SDK into Eclipse - Step 4

How to Use

The following section explains how to use the SecuritytextorgapiLib library in a new project.

1. Add a new Test Project

Create a new project in Eclipse by File -> New -> Go Project

Add a new project in Eclipse

Name the Project as Test and click Finish

Create a new Maven Project - Step 1

Create a new directory in the src directory of this project

Create a new Maven Project - Step 2

Name it test.com

Create a new Maven Project - Step 3

Now create a new file inside src/test.com

Create a new Maven Project - Step 4

Name it testsdk.go

Create a new Maven Project - Step 5

In this Go file, you can start adding code to initialize the client library. Sample code to initialize the client library and using its methods is given in the subsequent sections.

2. Configure the Test Project

You need to import your generated library in this project in order to make use of its functions. In order to import the library, you can add its path in the GOPATH for this project. Follow the below steps:

Right click on the project name and click on Properties

Adding dependency to the client library - Step 1

Choose Go Compiler from the side menu. Check Use project specific settings and uncheck Use same value as the GOPATH environment variable.. By default, the GOPATH value from the environment variables will be visible in Eclipse GOPATH. Do not remove this as this points to the unirest dependency.

Adding dependency to the client library - Step 2

Append the library path to this GOPATH

Adding dependency to the client library - Step 3

Once the path is appended, click on OK

3. Build the Test Project

Right click on the project name and click on Build Project

Build Project

4. Run the Test Project

If the build is successful, right click on your Go file and click on Run As -> Go Application

Run Project

Class Reference

List of Controllers

Class: whois_pkg

Get instance

Factory for the WHOIS interface can be accessed from the package whois_pkg.

whois := whois_pkg.NewWHOIS()

Method: CreateApiWhoisQuery

Tags: Skips Authentication

Query the server for a Domain object

func (me *WHOIS_IMPL) CreateApiWhoisQuery(body *models_pkg.RequestsQueryModel)(*models_pkg.ResponsesQueryModel,error)

Parameters

Parameter Tags Description
body Required Body of API request

Example Usage

var body *models_pkg.RequestsQueryModel

var result *models_pkg.ResponsesQueryModel
result,_ = whois.CreateApiWhoisQuery(body)

Errors

Error Code Error Description
400 Bad Request
406 Not Acceptable
500 Internal Server Error

Back to List of Controllers