imaggago

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 5 Imported by: 0

README

Imagga SDK for Go

Build Status GoDoc Go Report Card GitHub release

This is Imagga's unofficial Go client, designed to enable you to use Imagga's services easily from your own applications.

Imagga

Imagga is a cloud-based analytics service that through APIs allows you extract meaning from images and text.

SDK versions

API version SDK version
v2 v1.0.0

Getting started

Installation

You can load imagga-go into your project by using:

go get github.com/henomis/imagga-go
Configuration

The only thing you need to start using Imagga's APIs is the developer license key and related secret. Copy it and paste it in the corresponding place in the code, select the API you want to use and the parameters you want to use, and that's it.

Usage

Please refer to the examples folder to see how to use the SDK.

Here below a simple usage example:

package main

import (
	"encoding/json"
	"fmt"
	"log"

	imaggago "github.com/henomis/imagga-go"
	"github.com/henomis/imagga-go/pkg/request"
)

const apiKey = "YOUR_API_KEY"
const apiSecret = "YOUR_API_SECRET"

func main() {

	imaggaClient := imaggago.New(
		imaggago.ImaggaEndpointV2,
		apiKey,
		apiSecret,
		nil,
	)

	response, err := imaggaClient.Barcodes(
		&request.Barcodes{
			ImageURL: "https://imagga.com/static/images/technology/barcode.png",
		},
	)
	if err != nil {
		log.Fatal(err)
	}

	if !response.IsSuccess() {
		log.Fatal(response.Error())
	}

	bytes, _ := json.MarshalIndent(response, "", "  ")
	fmt.Println(string(bytes))

}

// support methods

func newBool(value bool) *bool {
	return &value
}

Documentation

Index

Constants

View Source
const (
	ImaggaEndpointV2 = "https://api.imagga.com/v2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ImaggaClient

type ImaggaClient struct {
	// contains filtered or unexported fields
}

func New

func New(endpoint string, apiKey, apiSecret string, timeout *time.Duration) *ImaggaClient

func (*ImaggaClient) Barcodes

func (i *ImaggaClient) Barcodes(barcodesRequest *request.Barcodes) (*response.Barcodes, error)

func (*ImaggaClient) Categories

func (i *ImaggaClient) Categories(categorizersRequest *request.Categories) (*response.Categories, error)

func (*ImaggaClient) Categorizers

func (i *ImaggaClient) Categorizers(categorizersRequest *request.Categorizers) (*response.Categorizers, error)

func (*ImaggaClient) Colors

func (i *ImaggaClient) Colors(croppingsRequest *request.Colors) (*response.Colors, error)

func (*ImaggaClient) Croppings

func (i *ImaggaClient) Croppings(croppingsRequest *request.Croppings) (*response.Croppings, error)

func (*ImaggaClient) DeleteUploads

func (i *ImaggaClient) DeleteUploads(uploadsRequest *request.Uploads) (*response.Uploads, error)

func (*ImaggaClient) FacesDetections

func (i *ImaggaClient) FacesDetections(facesDetectionsRequest *request.FacesDetections) (*response.FacesDetections, error)

func (*ImaggaClient) FacesGroupings

func (i *ImaggaClient) FacesGroupings(facesGroupingsRequest *request.FacesGroupings) (*response.FacesGroupings, error)

func (*ImaggaClient) FacesSimilarity

func (i *ImaggaClient) FacesSimilarity(facesSimilarityRequest *request.FacesSimilarity) (*response.FacesSimilarity, error)

func (*ImaggaClient) Tags

func (i *ImaggaClient) Tags(tagRequest *request.Tags) (*response.Tags, error)

func (*ImaggaClient) Text

func (i *ImaggaClient) Text(textRequest *request.Text) (*response.Text, error)

func (*ImaggaClient) Tickets

func (i *ImaggaClient) Tickets(ticketsRequest *request.Tickets) (*response.Tickets, error)

func (*ImaggaClient) Uploads

func (i *ImaggaClient) Uploads(uploadsRequest *request.Uploads) (*response.Uploads, error)

func (*ImaggaClient) Usage

func (i *ImaggaClient) Usage(usageRequest *request.Usage) (*response.Usage, error)

Jump to

Keyboard shortcuts

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