client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2016 License: Unlicense Imports: 6 Imported by: 2

README

cSense API Client

Client library for the cSense API.

Supported Endpoints:

  • Hooks

Installation

$ go get github.com/danielkrainas/csense/api/client

Usage

How to instantiate a new client:

package main

import (
	"net/http"
	"github.com/danielkrainas/csense/api/client"
)

// http/https url of the csense service
const ENDPOINT = "http://localhost:9181"

func main() {
	// Create a new client
	c := client.New(ENDPOINT, http.DefaultClient)
}

Example

A more detailed example can be found here.

Documentation

Index

Constants

View Source
const CLIENT_USER_AGENT = "csense-client/1.0.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Endpoint   string
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func New

func New(endpoint string, httpClient *http.Client) *Client

func (*Client) Hooks

func (c *Client) Hooks() HooksAPI

func (*Client) Ping

func (c *Client) Ping() error

type HooksAPI

type HooksAPI interface {
	CreateHook(r *v1.NewHookRequest) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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