common

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package common - common utility structs and functions

Package common - common utility structs and functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CError added in v0.4.0

type CError struct{ goutils.BaseError }

CError C function call error

func NewCError added in v0.4.0

func NewCError(message string, core error, getCallStack bool) CError

NewCError builds a CError, optionally capturing the call stack.

type CSlice

type CSlice interface {
	/*
		GetLen return the length of slice

			@returns the slice length
	*/
	GetLen() (int, error)

	/*
		GetSlice return reference to the slice

			@returns the managed slice
	*/
	GetSlice() ([]byte, error)

	/*
		GetCArray return reference to the C buffer

			@returns the C slice
	*/
	GetCArray() (unsafe.Pointer, error)
}

CSlice a slice object backed by "void*" array allocated in C side.

All implementations must register a de-allocation function with `runtime.SetFinalizer`

func AllocateBasicCSlice

func AllocateBasicCSlice(length int) (CSlice, error)

AllocateBasicCSlice allocate a basic C array backed slice

@param length uint64 - length of the array
@return CSlice object

type CryptoError added in v0.4.0

type CryptoError struct{ goutils.BaseError }

CryptoError Go standard crypto library call error

func NewCryptoError added in v0.4.0

func NewCryptoError(message string, core error, getCallStack bool) CryptoError

NewCryptoError builds a CryptoError, optionally capturing the call stack.

type SodiumError added in v0.4.0

type SodiumError struct{ goutils.BaseError }

SodiumError libsodium function call error

func NewSodiumError added in v0.4.0

func NewSodiumError(message string, core error, getCallStack bool) SodiumError

NewSodiumError builds a SodiumError, optionally capturing the call stack.

Jump to

Keyboard shortcuts

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