axstorage

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package axstorage provides a Go wrapper around the Axis ACAP SDK library, specifically the axstorage API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AXStorageGetStatus

func AXStorageGetStatus(storage_id StorageId, event AXStorageStatusEventId) (bool, error)

AXStorageGetStatus returns the status of the provided event for a storage.

func AxStorageSetupAsync

func AxStorageSetupAsync(storageID StorageId, callback StorageSetupCallback, userdata any) error

SetupAsync sets up storage for use asynchronously. Setup storage for use asynchronously. This method must be called before the storage is to be used in any way (for instance read or write). When done using the storage, AxStorageReleaseAsync must be called.

https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axstorage/html/ax__storage_8h.html#abb7bf1c1cab1961dc4c2fffedaaa73cd

func AxStorageSubscribe

func AxStorageSubscribe(storageID StorageId, callback StorageSubscriptionCallback, userdata any) (subscriptionId int, err error)

Subscribe subscribes to storage events for the provided storage ID.

https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axstorage/html/ax__storage_8h.html#ae64f800e6d88b54cf68cce925bb16312

func AxStorageUnsubscribe

func AxStorageUnsubscribe(subscriptionID int) error

Unsubscribe stops subscribing to storage events for the provided subscription ID.

https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axstorage/html/ax__storage_8h.html#a49676a4baae47e9407f3641fefcd365c

func GoStorageReleaseCallback

func GoStorageReleaseCallback(user_data unsafe.Pointer, gError *C.GError)

func GoStorageSetupCallback

func GoStorageSetupCallback(storage *C.AXStorage, user_data unsafe.Pointer, gError *C.GError)

func GoStorageSubscriptionCallback

func GoStorageSubscriptionCallback(storageID *C.char, user_data unsafe.Pointer, gError *C.GError)

func UpdateDiskItemEvents

func UpdateDiskItemEvents(d *DiskItem) error

Update the Available, Writable, Full, Exiting Event fields

Types

type AXStorage

type AXStorage struct {
	Ptr *C.AXStorage
}

https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axstorage/html/ax__storage_8h.html#aa14f17bf10b2dcc57d1ca16759da9b8f

func NewAxStorageFromC

func NewAxStorageFromC(storage *C.AXStorage) *AXStorage

func (*AXStorage) GetPath

func (s *AXStorage) GetPath() (string, error)

GetPath retrieves the location on the storage where the client should save its files.

func (*AXStorage) GetStorageId

func (s *AXStorage) GetStorageId() (StorageId, error)

GetStorageId gets the storage_id from the provided AXStorage.

func (*AXStorage) GetType

func (s *AXStorage) GetType() (AXStorageType, error)

GetType returns the storage type for the given AXStorage.

type AXStorageStatusEventId

type AXStorageStatusEventId int

AXStorageStatusEventId represents the list of events for AXStorage.

func (AXStorageStatusEventId) ErrorName

func (code AXStorageStatusEventId) ErrorName() string

ErrorName returns the string representation of the AXStorageStatusEventId.

type AXStorageType

type AXStorageType int

Just a int for the Storage type

const (
	AXStorageTypeLocal    AXStorageType = iota
	AXStorageTypeExternal AXStorageType = iota
	AXStorageTypeUnkown   AXStorageType = iota
)

type DiskItem

type DiskItem struct {
	SubscriptionId int           // Subscription ID for storage events
	Setup          bool          // TRUE: storage was set up async, FALSE otherwise
	Writable       bool          // Storage is writable or not
	Available      bool          // Storage is available or not
	Full           bool          // Storage device is full or not
	Exiting        bool          // Storage is exiting (going to disappear) or not
	Storage        *AXStorage    // AXStorage reference
	StorageType    AXStorageType // Storage type
	StorageId      StorageId     // Storage device name
	StoragePath    string        // Storage path
}

func NewDiskItem

func NewDiskItem(storageID StorageId, subscriptionId int) *DiskItem

NewDiskItem returns a new disk item

func (*DiskItem) String

func (d *DiskItem) String() string

type StorageError

type StorageError struct {
	Ptr      *C.GError
	Code     AXStorageStatusEventId
	Message  string
	Expected bool
}

func (*StorageError) Error

func (e *StorageError) Error() string

type StorageId

type StorageId string

Just a string for the storage id

func AxStorageList

func AxStorageList() ([]StorageId, error)

Lists all connected storage devices. The returned list and its members must be freed by the caller. Use g_free for the members and g_list_free for the list.

https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axstorage/html/ax__storage_8h.html#aa32bdb91706c44a86071c1c14889536f

type StorageReleaseCallback

type StorageReleaseCallback func(userdata any, err error)

StorageReleaseCallback is the Go equivalent of AXStorageReleaseCallback.

type StorageReleaseCallbackData

type StorageReleaseCallbackData struct {
	Callback StorageReleaseCallback
	Userdata any
}

type StorageSetupCallback

type StorageSetupCallback func(storage *AXStorage, userdata any, err error)

StorageSetupCallback is the Go equivalent of AXStorageSetupCallback.

type StorageSetupCallbackData

type StorageSetupCallbackData struct {
	Callback StorageSetupCallback
	Userdata any
}

type StorageSubscriptionCallback

type StorageSubscriptionCallback func(storageID StorageId, userdata any, err error)

StorageSubscriptionCallback is the Go equivalent of AXStorageSubscriptionCallback.

type StorageSubscriptionCallbackData

type StorageSubscriptionCallbackData struct {
	Callback StorageSubscriptionCallback
	Userdata any
}

Jump to

Keyboard shortcuts

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