vapix

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package vapix provides functions to interact with Axis camera VAPIX API.

Index

Constants

View Source
const INTERNAL_VAPIX_ENDPOINT = "http://127.0.0.12"

Variables

This section is empty.

Functions

func CheckForVapixError

func CheckForVapixError(vap VapixApiCall) error

func InternalVapixUrlPathJoin

func InternalVapixUrlPathJoin(path string) string

INTERNAL_VAPIX_ENDPOINT = "http://127.0.0.12" + given path

func ParseKeyValueRequestBody

func ParseKeyValueRequestBody(body io.Reader) (map[string]string, error)

func ParseUpdateResponse

func ParseUpdateResponse(body io.Reader) error

Types

type Param

type Param struct {
	Key   string
	Value string
}

type RequestResult

type RequestResult struct {
	IsOk           bool
	Error          error
	Password       string
	ResponseReader io.ReadCloser
	StatusCode     int
}

func VapixGet

func VapixGet(username, password, url string) RequestResult

on success the ResponseReader must be closed by user

func VapixPost

func VapixPost(username, password, url string, data interface{}) RequestResult

on success the ResponseReader must be closed by user

type VapixApiCall

type VapixApiCall struct {
	ApiVersion string      `json:"apiVersion"`
	Context    string      `json:"context"`
	Method     string      `json:"method"`
	Error      *VapixError `json:"error"`
	Data       struct {
		PropertiesList map[string]interface{} `json:"propertyList"`
	} `json:"data"`
}

func JsonResponseParser

func JsonResponseParser(responseReader io.ReadCloser) (*VapixApiCall, error)

func NewVapixBaseMethodCall

func NewVapixBaseMethodCall(method string) *VapixApiCall

type VapixError

type VapixError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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