Documentation ¶
Overview ¶
Package axstorage provides a Go wrapper around the Axis ACAP SDK library, specifically the axstorage API.
Index ¶
- func AXStorageGetStatus(storage_id StorageId, event AXStorageStatusEventId) (bool, error)
- func AxStorageSetupAsync(storageID StorageId, callback StorageSetupCallback, userdata any) error
- func AxStorageSubscribe(storageID StorageId, callback StorageSubscriptionCallback, userdata any) (subscriptionId int, err error)
- func AxStorageUnsubscribe(subscriptionID int) error
- func GoStorageReleaseCallback(user_data unsafe.Pointer, gError *C.GError)
- func GoStorageSetupCallback(storage *C.AXStorage, user_data unsafe.Pointer, gError *C.GError)
- func GoStorageSubscriptionCallback(storageID *C.char, user_data unsafe.Pointer, gError *C.GError)
- func UpdateDiskItemEvents(d *DiskItem) error
- type AXStorage
- type AXStorageStatusEventId
- type AXStorageType
- type DiskItem
- type StorageError
- type StorageId
- type StorageReleaseCallback
- type StorageReleaseCallbackData
- type StorageSetupCallback
- type StorageSetupCallbackData
- type StorageSubscriptionCallback
- type StorageSubscriptionCallbackData
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.
func AxStorageSubscribe ¶
func AxStorageSubscribe(storageID StorageId, callback StorageSubscriptionCallback, userdata any) (subscriptionId int, err error)
Subscribe subscribes to storage events for the provided storage ID.
func AxStorageUnsubscribe ¶
Unsubscribe stops subscribing to storage events for the provided subscription ID.
func GoStorageSetupCallback ¶
func UpdateDiskItemEvents ¶
Update the Available, Writable, Full, Exiting Event fields
Types ¶
type AXStorage ¶
func NewAxStorageFromC ¶
func (*AXStorage) AxStorageReleaseAsync ¶
func (s *AXStorage) AxStorageReleaseAsync(callback StorageReleaseCallback, userdata any) error
ReleaseAsync releases the use of storage asynchronously.
func (*AXStorage) GetPath ¶
GetPath retrieves the location on the storage where the client should save its files.
func (*AXStorage) GetStorageId ¶
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.
const ( AXStorageAvailableEvent AXStorageStatusEventId = C.AX_STORAGE_AVAILABLE_EVENT AXStorageExitingEvent AXStorageStatusEventId = C.AX_STORAGE_EXITING_EVENT AXStorageWritableEvent AXStorageStatusEventId = C.AX_STORAGE_WRITABLE_EVENT AXStorageFullEvent AXStorageStatusEventId = C.AX_STORAGE_FULL_EVENT AXStorageStatusEventIDEnd AXStorageStatusEventId = C.AX_STORAGE_STATUS_EVENT_ID_END )
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 ¶
NewDiskItem returns a new disk item
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 ¶
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.
type StorageReleaseCallback ¶
StorageReleaseCallback is the Go equivalent of AXStorageReleaseCallback.
type StorageReleaseCallbackData ¶
type StorageReleaseCallbackData struct { Callback StorageReleaseCallback Userdata any }
type StorageSetupCallback ¶
StorageSetupCallback is the Go equivalent of AXStorageSetupCallback.
type StorageSetupCallbackData ¶
type StorageSetupCallbackData struct { Callback StorageSetupCallback Userdata any }
type StorageSubscriptionCallback ¶
StorageSubscriptionCallback is the Go equivalent of AXStorageSubscriptionCallback.
type StorageSubscriptionCallbackData ¶
type StorageSubscriptionCallbackData struct { Callback StorageSubscriptionCallback Userdata any }