alsgoclient

package module
v0.0.0-...-3d66b51 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2018 License: MIT Imports: 9 Imported by: 0

README

ALS-Go Client Library for Go Lang projects

Website | Contributing

GoDoc Build Status Go Report Card Coverage Status

Example

package main

import (
	"github.com/Riftbit/als-go-client"
	"fmt"
	"github.com/Riftbit/ALS-Go/httpmodels"
)

func main() {
	conf := alsgoclient.Config{
		Uri: "http://als.local:8080/",
		Login: "ergoz",
		Password: "ergoz",
		IsAsync: false,
		Timeout: 1000,
	}
	client, err := alsgoclient.New(conf)
	if err != nil {
		panic(err)
	}

	fmt.Println("=============================")

	cats, _ := client.GetCategories()
	for _, dat := range cats.CategoriesList {
		fmt.Println(dat)
	}

	fmt.Println("=============================")

	args := httpmodels.RequestLogGetLog{Category: "capi", Limit: 10}
	result, _ := client.Get(args)
	for _,data := range result.LogList {
		fmt.Println(data.ID, "-", data.Message)
	}

	fmt.Println("=============================")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config
}

Client client object

func New

func New(config Config) (*Client, error)

func (*Client) Add

Add - call Log.Add

func (*Client) AddCustom

AddCustom - call Log.AddCustom

func (*Client) Get

Get - call Log.Get

func (*Client) GetCategories

func (s *Client) GetCategories() (httpmodels.ResponseLogGetCategories, error)

GetCategories - call Log.GetCategories

func (*Client) GetCount

GetCount - call Log.GetCount

func (*Client) ModifyTTL

ModifyTTL - call Log.ModifyTTL

func (*Client) Remove

Remove - call Log.Remove

func (*Client) RemoveCategory

RemoveCategory - call Log.RemoveCategory

func (*Client) Transfer

Transfer - call Log.Transfer

type Config

type Config struct {
	Uri      string `validate:"required"`
	Login    string `validate:"required"`
	Password string `validate:"required"`
	IsAsync  bool
	Timeout  int `validate:"required,gte=50,lte=60000"`
}

Config configuration structure

Jump to

Keyboard shortcuts

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