sumoll

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: MIT Imports: 7 Imported by: 1

README

sumoll

Small sumologic payload sender client

CircleCI Build Status Coverage Status Go Report Card GoDoc

Installation

$ go get github.com/ushios/sumoll

Usage

Send string to http source collection

client := NewHTTPSourceClient("http://collectors.au.sumologic.com/receiver/v1/http/...")
client.Send(strings.NewReader("your message here."))

Developing

Integration test

There's a test actually injecting data to sumologic. In order that to run, you need to set the env variable SUMOLL_TEST_HTTP_SOURCE_URL like this:

SUMOLL_TEST_HTTP_SOURCE_URL="https://collectors.eu.sumologic.com/receiver/v1/http/randomCollectorURL" go test --count=1 . -v

Documentation

Index

Constants

View Source
const (
	// Version string
	Version = "0.1"
)

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent string

Types

type HTTPSourceClient

type HTTPSourceClient struct {
	UserAgent string
	// contains filtered or unexported fields
}

HTTPSourceClient send to Resource HTTP

func NewHTTPSourceClient

func NewHTTPSourceClient(url *url.URL, opts ...HTTPSourceClientOptFunc) (*HTTPSourceClient, error)

NewHTTPSourceClient create HTTPSourceClient object

func (*HTTPSourceClient) Send

func (h *HTTPSourceClient) Send(body io.Reader) error

Send object to sumologic

type HTTPSourceClientOptFunc

type HTTPSourceClientOptFunc func(*HTTPSourceClient) error

HTTPSourceClientOptFunc set some values to client

func SetXSumoCategoryHeader

func SetXSumoCategoryHeader(category string) HTTPSourceClientOptFunc

SetXSumoCategoryHeader set X-Sumo-Category's value to header

func SetXSumoHostHeader

func SetXSumoHostHeader(host string) HTTPSourceClientOptFunc

SetXSumoHostHeader set X-Sumo-Host's value to header

func SetXSumoNameHeader

func SetXSumoNameHeader(name string) HTTPSourceClientOptFunc

SetXSumoNameHeader set X-Sumo-Name's value to header

Jump to

Keyboard shortcuts

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