slim_bindings

package module
v0.0.0-...-87816e7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

README

slim-bindings-go

go get github.com/agntcy/slim-bindings-go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSlimErrorAuthError = fmt.Errorf("SlimErrorAuthError")
View Source
var ErrSlimErrorInternalError = fmt.Errorf("SlimErrorInternalError")
View Source
var ErrSlimErrorInvalidArgument = fmt.Errorf("SlimErrorInvalidArgument")
View Source
var ErrSlimErrorReceiveError = fmt.Errorf("SlimErrorReceiveError")
View Source
var ErrSlimErrorSendError = fmt.Errorf("SlimErrorSendError")
View Source
var ErrSlimErrorServiceError = fmt.Errorf("SlimErrorServiceError")

Err* are used for checking error type with `errors.Is`

View Source
var ErrSlimErrorSessionError = fmt.Errorf("SlimErrorSessionError")
View Source
var ErrSlimErrorTimeout = fmt.Errorf("SlimErrorTimeout")
View Source
var FfiConverterBindingsAdapterINSTANCE = FfiConverterBindingsAdapter{}
View Source
var FfiConverterBindingsSessionContextINSTANCE = FfiConverterBindingsSessionContext{}
View Source
var FfiConverterBoolINSTANCE = FfiConverterBool{}
View Source
var FfiConverterBuildInfoINSTANCE = FfiConverterBuildInfo{}
View Source
var FfiConverterBytesINSTANCE = FfiConverterBytes{}
View Source
var FfiConverterClientConfigINSTANCE = FfiConverterClientConfig{}
View Source
var FfiConverterDurationINSTANCE = FfiConverterDuration{}
View Source
var FfiConverterFfiCompletionHandleINSTANCE = FfiConverterFfiCompletionHandle{}
View Source
var FfiConverterMapStringStringINSTANCE = FfiConverterMapStringString{}
View Source
var FfiConverterMessageContextINSTANCE = FfiConverterMessageContext{}
View Source
var FfiConverterNameINSTANCE = FfiConverterName{}
View Source
var FfiConverterOptionalBoolINSTANCE = FfiConverterOptionalBool{}
View Source
var FfiConverterOptionalMapStringStringINSTANCE = FfiConverterOptionalMapStringString{}
View Source
var FfiConverterOptionalNameINSTANCE = FfiConverterOptionalName{}
View Source
var FfiConverterOptionalStringINSTANCE = FfiConverterOptionalString{}
View Source
var FfiConverterOptionalUint32INSTANCE = FfiConverterOptionalUint32{}
View Source
var FfiConverterOptionalUint64INSTANCE = FfiConverterOptionalUint64{}
View Source
var FfiConverterReceivedMessageINSTANCE = FfiConverterReceivedMessage{}
View Source
var FfiConverterSequenceStringINSTANCE = FfiConverterSequenceString{}
View Source
var FfiConverterServerConfigINSTANCE = FfiConverterServerConfig{}
View Source
var FfiConverterSessionConfigINSTANCE = FfiConverterSessionConfig{}
View Source
var FfiConverterSessionTypeINSTANCE = FfiConverterSessionType{}
View Source
var FfiConverterSlimErrorINSTANCE = FfiConverterSlimError{}
View Source
var FfiConverterStringINSTANCE = FfiConverterString{}
View Source
var FfiConverterTlsConfigINSTANCE = FfiConverterTlsConfig{}
View Source
var FfiConverterUint32INSTANCE = FfiConverterUint32{}
View Source
var FfiConverterUint64INSTANCE = FfiConverterUint64{}

Functions

func GetVersion

func GetVersion() string

Get the version of the SLIM bindings (simple string)

func InitializeCryptoProvider

func InitializeCryptoProvider()

Initialize the crypto provider

This must be called before any TLS operations. It's safe to call multiple times.

func LiftFromRustBuffer

func LiftFromRustBuffer[GoType any](bufReader BufReader[GoType], rbuf RustBufferI) GoType

func LowerIntoRustBuffer

func LowerIntoRustBuffer[GoType any](bufWriter BufWriter[GoType], value GoType) C.RustBuffer

Types

type BindingsAdapter

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

Adapter that bridges the App API with language-bindings interface

This adapter uses enum-based auth types (`AuthProvider`/`AuthVerifier`) instead of generics to be compatible with UniFFI, supporting multiple authentication mechanisms (SharedSecret, JWT, SPIRE, StaticToken). It provides both synchronous (blocking) and asynchronous methods for flexibility.

func CreateAppWithSecret

func CreateAppWithSecret(appName Name, sharedSecret string) (*BindingsAdapter, error)

Create an app with the given name and shared secret (blocking version for FFI)

This is the main entry point for creating a SLIM application from language bindings.

func (*BindingsAdapter) Connect

func (_self *BindingsAdapter) Connect(config ClientConfig) (uint64, error)

Connect to a SLIM server as a client (blocking version for FFI)

# Arguments * `config` - Client configuration (endpoint and TLS settings)

# Returns * `Ok(connection_id)` - Connected successfully, returns the connection ID * `Err(SlimError)` - If connection fails

func (*BindingsAdapter) ConnectAsync

func (_self *BindingsAdapter) ConnectAsync(config ClientConfig) (uint64, error)

Connect to a SLIM server (async version)

Note: Automatically subscribes to the app's own name after connecting to enable receiving inbound messages and sessions.

func (*BindingsAdapter) CreateSession

func (_self *BindingsAdapter) CreateSession(config SessionConfig, destination Name) (*BindingsSessionContext, error)

Create a new session (blocking version for FFI)

func (*BindingsAdapter) CreateSessionAsync

func (_self *BindingsAdapter) CreateSessionAsync(config SessionConfig, destination Name) (*BindingsSessionContext, error)

Create a new session (async version)

**Auto-waits for session establishment:** This method automatically waits for the session handshake to complete before returning. For point-to-point sessions, this ensures the remote peer has acknowledged the session. For multicast sessions, this ensures the initial setup is complete.

func (*BindingsAdapter) DeleteSession

func (_self *BindingsAdapter) DeleteSession(session *BindingsSessionContext) error

Delete a session (blocking version for FFI)

func (*BindingsAdapter) DeleteSessionAsync

func (_self *BindingsAdapter) DeleteSessionAsync(session *BindingsSessionContext) error

Delete a session (async version)

func (*BindingsAdapter) Destroy

func (object *BindingsAdapter) Destroy()

func (*BindingsAdapter) Disconnect

func (_self *BindingsAdapter) Disconnect(connectionId uint64) error

Disconnect from a SLIM server (blocking version for FFI)

# Arguments * `connection_id` - The connection ID returned from `connect()`

# Returns * `Ok(())` - Disconnected successfully * `Err(SlimError)` - If disconnection fails

func (*BindingsAdapter) DisconnectAsync

func (_self *BindingsAdapter) DisconnectAsync(connectionId uint64) error

Disconnect from a SLIM server (async version)

func (*BindingsAdapter) Id

func (_self *BindingsAdapter) Id() uint64

Get the app ID (derived from name)

func (*BindingsAdapter) ListenForSession

func (_self *BindingsAdapter) ListenForSession(timeoutMs *uint32) (*BindingsSessionContext, error)

Listen for incoming sessions (blocking version for FFI)

func (*BindingsAdapter) ListenForSessionAsync

func (_self *BindingsAdapter) ListenForSessionAsync(timeoutMs *uint32) (*BindingsSessionContext, error)

Listen for incoming sessions (async version)

func (*BindingsAdapter) Name

func (_self *BindingsAdapter) Name() Name

Get the app name

func (*BindingsAdapter) RemoveRoute

func (_self *BindingsAdapter) RemoveRoute(name Name, connectionId uint64) error

Remove a route (blocking version for FFI)

func (*BindingsAdapter) RemoveRouteAsync

func (_self *BindingsAdapter) RemoveRouteAsync(name Name, connectionId uint64) error

Remove a route (async version)

func (*BindingsAdapter) RunServer

func (_self *BindingsAdapter) RunServer(config ServerConfig) error

Run a SLIM server on the specified endpoint (blocking version for FFI)

# Arguments * `config` - Server configuration (endpoint and TLS settings)

# Returns * `Ok(())` - Server started successfully * `Err(SlimError)` - If server startup fails

func (*BindingsAdapter) RunServerAsync

func (_self *BindingsAdapter) RunServerAsync(config ServerConfig) error

Run a SLIM server (async version)

func (*BindingsAdapter) SetRoute

func (_self *BindingsAdapter) SetRoute(name Name, connectionId uint64) error

Set a route to a name for a specific connection (blocking version for FFI)

func (*BindingsAdapter) SetRouteAsync

func (_self *BindingsAdapter) SetRouteAsync(name Name, connectionId uint64) error

Set a route to a name for a specific connection (async version)

func (*BindingsAdapter) StopServer

func (_self *BindingsAdapter) StopServer(endpoint string) error

Stop a running SLIM server (blocking version for FFI)

# Arguments * `endpoint` - The endpoint address of the server to stop (e.g., "127.0.0.1:12345")

# Returns * `Ok(())` - Server stopped successfully * `Err(SlimError)` - If server not found or stop fails

func (*BindingsAdapter) Subscribe

func (_self *BindingsAdapter) Subscribe(name Name, connectionId *uint64) error

Subscribe to a name (blocking version for FFI)

func (*BindingsAdapter) SubscribeAsync

func (_self *BindingsAdapter) SubscribeAsync(name Name, connectionId *uint64) error

Subscribe to a name (async version)

func (*BindingsAdapter) Unsubscribe

func (_self *BindingsAdapter) Unsubscribe(name Name, connectionId *uint64) error

Unsubscribe from a name (blocking version for FFI)

func (*BindingsAdapter) UnsubscribeAsync

func (_self *BindingsAdapter) UnsubscribeAsync(name Name, connectionId *uint64) error

Unsubscribe from a name (async version)

type BindingsAdapterInterface

type BindingsAdapterInterface interface {
	// Connect to a SLIM server as a client (blocking version for FFI)
	//
	// # Arguments
	// * `config` - Client configuration (endpoint and TLS settings)
	//
	// # Returns
	// * `Ok(connection_id)` - Connected successfully, returns the connection ID
	// * `Err(SlimError)` - If connection fails
	Connect(config ClientConfig) (uint64, error)
	// Connect to a SLIM server (async version)
	//
	// Note: Automatically subscribes to the app's own name after connecting
	// to enable receiving inbound messages and sessions.
	ConnectAsync(config ClientConfig) (uint64, error)
	// Create a new session (blocking version for FFI)
	CreateSession(config SessionConfig, destination Name) (*BindingsSessionContext, error)
	// Create a new session (async version)
	//
	// **Auto-waits for session establishment:** This method automatically waits for the
	// session handshake to complete before returning. For point-to-point sessions, this
	// ensures the remote peer has acknowledged the session. For multicast sessions, this
	// ensures the initial setup is complete.
	CreateSessionAsync(config SessionConfig, destination Name) (*BindingsSessionContext, error)
	// Delete a session (blocking version for FFI)
	DeleteSession(session *BindingsSessionContext) error
	// Delete a session (async version)
	DeleteSessionAsync(session *BindingsSessionContext) error
	// Disconnect from a SLIM server (blocking version for FFI)
	//
	// # Arguments
	// * `connection_id` - The connection ID returned from `connect()`
	//
	// # Returns
	// * `Ok(())` - Disconnected successfully
	// * `Err(SlimError)` - If disconnection fails
	Disconnect(connectionId uint64) error
	// Disconnect from a SLIM server (async version)
	DisconnectAsync(connectionId uint64) error
	// Get the app ID (derived from name)
	Id() uint64
	// Listen for incoming sessions (blocking version for FFI)
	ListenForSession(timeoutMs *uint32) (*BindingsSessionContext, error)
	// Listen for incoming sessions (async version)
	ListenForSessionAsync(timeoutMs *uint32) (*BindingsSessionContext, error)
	// Get the app name
	Name() Name
	// Remove a route (blocking version for FFI)
	RemoveRoute(name Name, connectionId uint64) error
	// Remove a route (async version)
	RemoveRouteAsync(name Name, connectionId uint64) error
	// Run a SLIM server on the specified endpoint (blocking version for FFI)
	//
	// # Arguments
	// * `config` - Server configuration (endpoint and TLS settings)
	//
	// # Returns
	// * `Ok(())` - Server started successfully
	// * `Err(SlimError)` - If server startup fails
	RunServer(config ServerConfig) error
	// Run a SLIM server (async version)
	RunServerAsync(config ServerConfig) error
	// Set a route to a name for a specific connection (blocking version for FFI)
	SetRoute(name Name, connectionId uint64) error
	// Set a route to a name for a specific connection (async version)
	SetRouteAsync(name Name, connectionId uint64) error
	// Stop a running SLIM server (blocking version for FFI)
	//
	// # Arguments
	// * `endpoint` - The endpoint address of the server to stop (e.g., "127.0.0.1:12345")
	//
	// # Returns
	// * `Ok(())` - Server stopped successfully
	// * `Err(SlimError)` - If server not found or stop fails
	StopServer(endpoint string) error
	// Subscribe to a name (blocking version for FFI)
	Subscribe(name Name, connectionId *uint64) error
	// Subscribe to a name (async version)
	SubscribeAsync(name Name, connectionId *uint64) error
	// Unsubscribe from a name (blocking version for FFI)
	Unsubscribe(name Name, connectionId *uint64) error
	// Unsubscribe from a name (async version)
	UnsubscribeAsync(name Name, connectionId *uint64) error
}

Adapter that bridges the App API with language-bindings interface

This adapter uses enum-based auth types (`AuthProvider`/`AuthVerifier`) instead of generics to be compatible with UniFFI, supporting multiple authentication mechanisms (SharedSecret, JWT, SPIRE, StaticToken). It provides both synchronous (blocking) and asynchronous methods for flexibility.

type BindingsSessionContext

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

Session context for language bindings (UniFFI-compatible)

Wraps the session context with proper async access patterns for message reception. Provides both synchronous (blocking) and asynchronous methods for FFI compatibility.

func (*BindingsSessionContext) Destination

func (_self *BindingsSessionContext) Destination() (Name, error)

Get the destination name for this session

func (*BindingsSessionContext) Destroy

func (object *BindingsSessionContext) Destroy()

func (*BindingsSessionContext) GetMessage

func (_self *BindingsSessionContext) GetMessage(timeoutMs *uint32) (ReceivedMessage, error)

Receive a message from the session (blocking version for FFI)

# Arguments * `timeout_ms` - Optional timeout in milliseconds

# Returns * `Ok(ReceivedMessage)` - Message with context and payload bytes * `Err(SlimError)` - If the receive fails or times out

func (*BindingsSessionContext) GetMessageAsync

func (_self *BindingsSessionContext) GetMessageAsync(timeoutMs *uint32) (ReceivedMessage, error)

Receive a message from the session (async version)

func (*BindingsSessionContext) Invite

func (_self *BindingsSessionContext) Invite(participant Name) error

Invite a participant to the session (blocking version for FFI)

**Auto-waits for completion:** This method automatically waits for the invitation to be sent and acknowledged before returning.

func (*BindingsSessionContext) InviteAsync

func (_self *BindingsSessionContext) InviteAsync(participant Name) error

Invite a participant to the session (async version)

**Auto-waits for completion:** This method automatically waits for the invitation to be sent and acknowledged before returning.

func (*BindingsSessionContext) IsInitiator

func (_self *BindingsSessionContext) IsInitiator() (bool, error)

Check if this session is the initiator

func (*BindingsSessionContext) Publish

func (_self *BindingsSessionContext) Publish(data []byte, payloadType *string, metadata *map[string]string) error

Publish a message to the session's destination (fire-and-forget, blocking version)

This is the simple "fire-and-forget" API that most users want. The message is queued for sending and this method returns immediately without waiting for delivery confirmation.

**When to use:** Most common use case where you don't need delivery confirmation.

**When not to use:** If you need to ensure the message was delivered, use `publish_with_completion()` instead.

# Arguments * `data` - The message payload bytes * `payload_type` - Optional content type identifier * `metadata` - Optional key-value metadata pairs

# Returns * `Ok(())` - Message queued successfully * `Err(SlimError)` - If publishing fails

func (*BindingsSessionContext) PublishAsync

func (_self *BindingsSessionContext) PublishAsync(data []byte, payloadType *string, metadata *map[string]string) error

Publish a message to the session's destination (fire-and-forget, async version)

func (*BindingsSessionContext) PublishTo

func (_self *BindingsSessionContext) PublishTo(messageContext MessageContext, data []byte, payloadType *string, metadata *map[string]string) error

Publish a reply message to the originator of a received message (blocking version for FFI)

This method uses the routing information from a previously received message to send a reply back to the sender. This is the preferred way to implement request/reply patterns.

# Arguments * `message_context` - Context from a message received via `get_message()` * `data` - The reply payload bytes * `payload_type` - Optional content type identifier * `metadata` - Optional key-value metadata pairs

# Returns * `Ok(())` on success * `Err(SlimError)` if publishing fails

func (*BindingsSessionContext) PublishToAsync

func (_self *BindingsSessionContext) PublishToAsync(messageContext MessageContext, data []byte, payloadType *string, metadata *map[string]string) error

Publish a reply message (fire-and-forget, async version)

func (*BindingsSessionContext) PublishToWithCompletion

func (_self *BindingsSessionContext) PublishToWithCompletion(messageContext MessageContext, data []byte, payloadType *string, metadata *map[string]string) (*FfiCompletionHandle, error)

Publish a reply message with delivery confirmation (blocking version)

Similar to `publish_with_completion()` but for reply messages. Returns a completion handle to await delivery confirmation.

# Arguments * `message_context` - Context from a message received via `get_message()` * `data` - The reply payload bytes * `payload_type` - Optional content type identifier * `metadata` - Optional key-value metadata pairs

# Returns * `Ok(FfiCompletionHandle)` - Handle to await delivery confirmation * `Err(SlimError)` - If publishing fails

func (*BindingsSessionContext) PublishToWithCompletionAsync

func (_self *BindingsSessionContext) PublishToWithCompletionAsync(messageContext MessageContext, data []byte, payloadType *string, metadata *map[string]string) (*FfiCompletionHandle, error)

Publish a reply message with delivery confirmation (async version)

func (*BindingsSessionContext) PublishWithCompletion

func (_self *BindingsSessionContext) PublishWithCompletion(data []byte, payloadType *string, metadata *map[string]string) (*FfiCompletionHandle, error)

Publish a message with delivery confirmation (blocking version)

This variant returns a `FfiCompletionHandle` that can be awaited to ensure the message was delivered successfully. Use this when you need reliable delivery confirmation.

**When to use:** Critical messages where you need delivery confirmation.

# Arguments * `data` - The message payload bytes * `payload_type` - Optional content type identifier * `metadata` - Optional key-value metadata pairs

# Returns * `Ok(FfiCompletionHandle)` - Handle to await delivery confirmation * `Err(SlimError)` - If publishing fails

# Example ```ignore let completion = session.publish_with_completion(data, None, None)?; completion.wait()?; // Blocks until message is delivered ```

func (*BindingsSessionContext) PublishWithCompletionAsync

func (_self *BindingsSessionContext) PublishWithCompletionAsync(data []byte, payloadType *string, metadata *map[string]string) (*FfiCompletionHandle, error)

Publish a message with delivery confirmation (async version)

func (*BindingsSessionContext) PublishWithParams

func (_self *BindingsSessionContext) PublishWithParams(destination Name, fanout uint32, data []byte, connectionOut *uint64, payloadType *string, metadata *map[string]string) error

Low-level publish with full control over all parameters (blocking version for FFI)

This is an advanced method that provides complete control over routing and delivery. Most users should use `publish()` or `publish_to()` instead.

# Arguments * `destination` - Target name to send to * `fanout` - Number of copies to send (for multicast) * `data` - The message payload bytes * `connection_out` - Optional specific connection ID to use * `payload_type` - Optional content type identifier * `metadata` - Optional key-value metadata pairs

func (*BindingsSessionContext) PublishWithParamsAsync

func (_self *BindingsSessionContext) PublishWithParamsAsync(destination Name, fanout uint32, data []byte, connectionOut *uint64, payloadType *string, metadata *map[string]string) error

Low-level publish with full control (async version)

func (*BindingsSessionContext) Remove

func (_self *BindingsSessionContext) Remove(participant Name) error

Remove a participant from the session (blocking version for FFI)

**Auto-waits for completion:** This method automatically waits for the removal to be processed and acknowledged before returning.

func (*BindingsSessionContext) RemoveAsync

func (_self *BindingsSessionContext) RemoveAsync(participant Name) error

Remove a participant from the session (async version)

**Auto-waits for completion:** This method automatically waits for the removal to be processed and acknowledged before returning.

func (*BindingsSessionContext) SessionId

func (_self *BindingsSessionContext) SessionId() (uint32, error)

Get the session ID

func (*BindingsSessionContext) SessionType

func (_self *BindingsSessionContext) SessionType() (SessionType, error)

Get the session type (PointToPoint or Group)

func (*BindingsSessionContext) Source

func (_self *BindingsSessionContext) Source() (Name, error)

Get the source name for this session

type BindingsSessionContextInterface

type BindingsSessionContextInterface interface {
	// Get the destination name for this session
	Destination() (Name, error)
	// Receive a message from the session (blocking version for FFI)
	//
	// # Arguments
	// * `timeout_ms` - Optional timeout in milliseconds
	//
	// # Returns
	// * `Ok(ReceivedMessage)` - Message with context and payload bytes
	// * `Err(SlimError)` - If the receive fails or times out
	GetMessage(timeoutMs *uint32) (ReceivedMessage, error)
	// Receive a message from the session (async version)
	GetMessageAsync(timeoutMs *uint32) (ReceivedMessage, error)
	// Invite a participant to the session (blocking version for FFI)
	//
	// **Auto-waits for completion:** This method automatically waits for the
	// invitation to be sent and acknowledged before returning.
	Invite(participant Name) error
	// Invite a participant to the session (async version)
	//
	// **Auto-waits for completion:** This method automatically waits for the
	// invitation to be sent and acknowledged before returning.
	InviteAsync(participant Name) error
	// Check if this session is the initiator
	IsInitiator() (bool, error)
	// Publish a message to the session's destination (fire-and-forget, blocking version)
	//
	// This is the simple "fire-and-forget" API that most users want.
	// The message is queued for sending and this method returns immediately without
	// waiting for delivery confirmation.
	//
	// **When to use:** Most common use case where you don't need delivery confirmation.
	//
	// **When not to use:** If you need to ensure the message was delivered, use
	// `publish_with_completion()` instead.
	//
	// # Arguments
	// * `data` - The message payload bytes
	// * `payload_type` - Optional content type identifier
	// * `metadata` - Optional key-value metadata pairs
	//
	// # Returns
	// * `Ok(())` - Message queued successfully
	// * `Err(SlimError)` - If publishing fails
	Publish(data []byte, payloadType *string, metadata *map[string]string) error
	// Publish a message to the session's destination (fire-and-forget, async version)
	PublishAsync(data []byte, payloadType *string, metadata *map[string]string) error
	// Publish a reply message to the originator of a received message (blocking version for FFI)
	//
	// This method uses the routing information from a previously received message
	// to send a reply back to the sender. This is the preferred way to implement
	// request/reply patterns.
	//
	// # Arguments
	// * `message_context` - Context from a message received via `get_message()`
	// * `data` - The reply payload bytes
	// * `payload_type` - Optional content type identifier
	// * `metadata` - Optional key-value metadata pairs
	//
	// # Returns
	// * `Ok(())` on success
	// * `Err(SlimError)` if publishing fails
	PublishTo(messageContext MessageContext, data []byte, payloadType *string, metadata *map[string]string) error
	// Publish a reply message (fire-and-forget, async version)
	PublishToAsync(messageContext MessageContext, data []byte, payloadType *string, metadata *map[string]string) error
	// Publish a reply message with delivery confirmation (blocking version)
	//
	// Similar to `publish_with_completion()` but for reply messages.
	// Returns a completion handle to await delivery confirmation.
	//
	// # Arguments
	// * `message_context` - Context from a message received via `get_message()`
	// * `data` - The reply payload bytes
	// * `payload_type` - Optional content type identifier
	// * `metadata` - Optional key-value metadata pairs
	//
	// # Returns
	// * `Ok(FfiCompletionHandle)` - Handle to await delivery confirmation
	// * `Err(SlimError)` - If publishing fails
	PublishToWithCompletion(messageContext MessageContext, data []byte, payloadType *string, metadata *map[string]string) (*FfiCompletionHandle, error)
	// Publish a reply message with delivery confirmation (async version)
	PublishToWithCompletionAsync(messageContext MessageContext, data []byte, payloadType *string, metadata *map[string]string) (*FfiCompletionHandle, error)
	// Publish a message with delivery confirmation (blocking version)
	//
	// This variant returns a `FfiCompletionHandle` that can be awaited to ensure
	// the message was delivered successfully. Use this when you need reliable
	// delivery confirmation.
	//
	// **When to use:** Critical messages where you need delivery confirmation.
	//
	// # Arguments
	// * `data` - The message payload bytes
	// * `payload_type` - Optional content type identifier
	// * `metadata` - Optional key-value metadata pairs
	//
	// # Returns
	// * `Ok(FfiCompletionHandle)` - Handle to await delivery confirmation
	// * `Err(SlimError)` - If publishing fails
	//
	// # Example
	// “`ignore
	// let completion = session.publish_with_completion(data, None, None)?;
	// completion.wait()?; // Blocks until message is delivered
	// “`
	PublishWithCompletion(data []byte, payloadType *string, metadata *map[string]string) (*FfiCompletionHandle, error)
	// Publish a message with delivery confirmation (async version)
	PublishWithCompletionAsync(data []byte, payloadType *string, metadata *map[string]string) (*FfiCompletionHandle, error)
	// Low-level publish with full control over all parameters (blocking version for FFI)
	//
	// This is an advanced method that provides complete control over routing and delivery.
	// Most users should use `publish()` or `publish_to()` instead.
	//
	// # Arguments
	// * `destination` - Target name to send to
	// * `fanout` - Number of copies to send (for multicast)
	// * `data` - The message payload bytes
	// * `connection_out` - Optional specific connection ID to use
	// * `payload_type` - Optional content type identifier
	// * `metadata` - Optional key-value metadata pairs
	PublishWithParams(destination Name, fanout uint32, data []byte, connectionOut *uint64, payloadType *string, metadata *map[string]string) error
	// Low-level publish with full control (async version)
	PublishWithParamsAsync(destination Name, fanout uint32, data []byte, connectionOut *uint64, payloadType *string, metadata *map[string]string) error
	// Remove a participant from the session (blocking version for FFI)
	//
	// **Auto-waits for completion:** This method automatically waits for the
	// removal to be processed and acknowledged before returning.
	Remove(participant Name) error
	// Remove a participant from the session (async version)
	//
	// **Auto-waits for completion:** This method automatically waits for the
	// removal to be processed and acknowledged before returning.
	RemoveAsync(participant Name) error
	// Get the session ID
	SessionId() (uint32, error)
	// Get the session type (PointToPoint or Group)
	SessionType() (SessionType, error)
	// Get the source name for this session
	Source() (Name, error)
}

Session context for language bindings (UniFFI-compatible)

Wraps the session context with proper async access patterns for message reception. Provides both synchronous (blocking) and asynchronous methods for FFI compatibility.

type BufLifter

type BufLifter[GoType any] interface {
	Lift(value RustBufferI) GoType
}

type BufLowerer

type BufLowerer[GoType any] interface {
	Lower(value GoType) C.RustBuffer
}

type BufReader

type BufReader[GoType any] interface {
	Read(reader io.Reader) GoType
}

type BufWriter

type BufWriter[GoType any] interface {
	Write(writer io.Writer, value GoType)
}

type BuildInfo

type BuildInfo struct {
	// Semantic version (e.g., "0.7.0")
	Version string
	// Git commit hash (short)
	GitSha string
	// Build date in ISO 8601 UTC format
	BuildDate string
	// Build profile (debug/release)
	Profile string
}

Build information for the SLIM bindings

func GetBuildInfo

func GetBuildInfo() BuildInfo

Get detailed build information

func (*BuildInfo) Destroy

func (r *BuildInfo) Destroy()

type ClientConfig

type ClientConfig struct {
	Endpoint string
	Tls      TlsConfig
}

Client configuration for connecting to a SLIM server

func (*ClientConfig) Destroy

func (r *ClientConfig) Destroy()

type FfiCompletionHandle

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

FFI-compatible completion handle for async operations

Represents a pending operation that can be awaited to ensure completion. Used for operations that need delivery confirmation or handshake acknowledgment.

# Design Note Since Rust futures can only be polled once to completion, this handle uses a shared receiver that can only be consumed once. Attempting to wait multiple times on the same handle will return an error.

Examples

Basic usage: ```ignore let completion = session.publish_with_completion(data, None, None)?; completion.wait()?; // Wait for delivery confirmation ```

func (*FfiCompletionHandle) Destroy

func (object *FfiCompletionHandle) Destroy()

func (*FfiCompletionHandle) Wait

func (_self *FfiCompletionHandle) Wait() error

Wait for the operation to complete indefinitely (blocking version)

This blocks the calling thread until the operation completes. Use this from Go or other languages when you need to ensure an operation has finished before proceeding.

**Note:** This can only be called once per handle. Subsequent calls will return an error.

# Returns * `Ok(())` - Operation completed successfully * `Err(SlimError)` - Operation failed or handle already consumed

func (*FfiCompletionHandle) WaitAsync

func (_self *FfiCompletionHandle) WaitAsync() error

Wait for the operation to complete indefinitely (async version)

This is the async version that integrates with UniFFI's polling mechanism. The operation will yield control while waiting.

**Note:** This can only be called once per handle. Subsequent calls will return an error.

# Returns * `Ok(())` - Operation completed successfully * `Err(SlimError)` - Operation failed or handle already consumed

func (*FfiCompletionHandle) WaitFor

func (_self *FfiCompletionHandle) WaitFor(timeout time.Duration) error

Wait for the operation to complete with a timeout (blocking version)

This blocks the calling thread until the operation completes or the timeout expires. Use this from Go or other languages when you need to ensure an operation has finished before proceeding with a time limit.

**Note:** This can only be called once per handle. Subsequent calls will return an error.

# Arguments * `timeout` - Maximum time to wait for completion

# Returns * `Ok(())` - Operation completed successfully * `Err(SlimError::Timeout)` - If the operation timed out * `Err(SlimError)` - Operation failed or handle already consumed

func (*FfiCompletionHandle) WaitForAsync

func (_self *FfiCompletionHandle) WaitForAsync(timeout time.Duration) error

Wait for the operation to complete with a timeout (async version)

This is the async version that integrates with UniFFI's polling mechanism. The operation will yield control while waiting until completion or timeout.

**Note:** This can only be called once per handle. Subsequent calls will return an error.

# Arguments * `timeout` - Maximum time to wait for completion

# Returns * `Ok(())` - Operation completed successfully * `Err(SlimError::Timeout)` - If the operation timed out * `Err(SlimError)` - Operation failed or handle already consumed

type FfiCompletionHandleInterface

type FfiCompletionHandleInterface interface {
	// Wait for the operation to complete indefinitely (blocking version)
	//
	// This blocks the calling thread until the operation completes.
	// Use this from Go or other languages when you need to ensure
	// an operation has finished before proceeding.
	//
	// **Note:** This can only be called once per handle. Subsequent calls
	// will return an error.
	//
	// # Returns
	// * `Ok(())` - Operation completed successfully
	// * `Err(SlimError)` - Operation failed or handle already consumed
	Wait() error
	// Wait for the operation to complete indefinitely (async version)
	//
	// This is the async version that integrates with UniFFI's polling mechanism.
	// The operation will yield control while waiting.
	//
	// **Note:** This can only be called once per handle. Subsequent calls
	// will return an error.
	//
	// # Returns
	// * `Ok(())` - Operation completed successfully
	// * `Err(SlimError)` - Operation failed or handle already consumed
	WaitAsync() error
	// Wait for the operation to complete with a timeout (blocking version)
	//
	// This blocks the calling thread until the operation completes or the timeout expires.
	// Use this from Go or other languages when you need to ensure
	// an operation has finished before proceeding with a time limit.
	//
	// **Note:** This can only be called once per handle. Subsequent calls
	// will return an error.
	//
	// # Arguments
	// * `timeout` - Maximum time to wait for completion
	//
	// # Returns
	// * `Ok(())` - Operation completed successfully
	// * `Err(SlimError::Timeout)` - If the operation timed out
	// * `Err(SlimError)` - Operation failed or handle already consumed
	WaitFor(timeout time.Duration) error
	// Wait for the operation to complete with a timeout (async version)
	//
	// This is the async version that integrates with UniFFI's polling mechanism.
	// The operation will yield control while waiting until completion or timeout.
	//
	// **Note:** This can only be called once per handle. Subsequent calls
	// will return an error.
	//
	// # Arguments
	// * `timeout` - Maximum time to wait for completion
	//
	// # Returns
	// * `Ok(())` - Operation completed successfully
	// * `Err(SlimError::Timeout)` - If the operation timed out
	// * `Err(SlimError)` - Operation failed or handle already consumed
	WaitForAsync(timeout time.Duration) error
}

FFI-compatible completion handle for async operations

Represents a pending operation that can be awaited to ensure completion. Used for operations that need delivery confirmation or handshake acknowledgment.

# Design Note Since Rust futures can only be polled once to completion, this handle uses a shared receiver that can only be consumed once. Attempting to wait multiple times on the same handle will return an error.

Examples

Basic usage: ```ignore let completion = session.publish_with_completion(data, None, None)?; completion.wait()?; // Wait for delivery confirmation ```

type FfiConverterBindingsAdapter

type FfiConverterBindingsAdapter struct{}

func (FfiConverterBindingsAdapter) Lift

func (FfiConverterBindingsAdapter) Lower

func (FfiConverterBindingsAdapter) Read

func (FfiConverterBindingsAdapter) Write

func (c FfiConverterBindingsAdapter) Write(writer io.Writer, value *BindingsAdapter)

type FfiConverterBindingsSessionContext

type FfiConverterBindingsSessionContext struct{}

func (FfiConverterBindingsSessionContext) Lift

func (FfiConverterBindingsSessionContext) Lower

func (FfiConverterBindingsSessionContext) Read

func (FfiConverterBindingsSessionContext) Write

type FfiConverterBool

type FfiConverterBool struct{}

func (FfiConverterBool) Lift

func (FfiConverterBool) Lift(value C.int8_t) bool

func (FfiConverterBool) Lower

func (FfiConverterBool) Lower(value bool) C.int8_t

func (FfiConverterBool) Read

func (FfiConverterBool) Read(reader io.Reader) bool

func (FfiConverterBool) Write

func (FfiConverterBool) Write(writer io.Writer, value bool)

type FfiConverterBuildInfo

type FfiConverterBuildInfo struct{}

func (FfiConverterBuildInfo) Lift

func (FfiConverterBuildInfo) Lower

func (FfiConverterBuildInfo) Read

func (c FfiConverterBuildInfo) Read(reader io.Reader) BuildInfo

func (FfiConverterBuildInfo) Write

func (c FfiConverterBuildInfo) Write(writer io.Writer, value BuildInfo)

type FfiConverterBytes

type FfiConverterBytes struct{}

func (FfiConverterBytes) Lift

func (c FfiConverterBytes) Lift(rb RustBufferI) []byte

func (FfiConverterBytes) Lower

func (c FfiConverterBytes) Lower(value []byte) C.RustBuffer

func (FfiConverterBytes) Read

func (c FfiConverterBytes) Read(reader io.Reader) []byte

func (FfiConverterBytes) Write

func (c FfiConverterBytes) Write(writer io.Writer, value []byte)

type FfiConverterClientConfig

type FfiConverterClientConfig struct{}

func (FfiConverterClientConfig) Lift

func (FfiConverterClientConfig) Lower

func (FfiConverterClientConfig) Read

func (FfiConverterClientConfig) Write

func (c FfiConverterClientConfig) Write(writer io.Writer, value ClientConfig)

type FfiConverterDuration

type FfiConverterDuration struct{}

FfiConverterDuration converts between uniffi duration and Go duration.

func (FfiConverterDuration) Lift

func (FfiConverterDuration) Lower

func (FfiConverterDuration) Read

func (c FfiConverterDuration) Read(reader io.Reader) time.Duration

func (FfiConverterDuration) Write

func (c FfiConverterDuration) Write(writer io.Writer, value time.Duration)

type FfiConverterFfiCompletionHandle

type FfiConverterFfiCompletionHandle struct{}

func (FfiConverterFfiCompletionHandle) Lift

func (FfiConverterFfiCompletionHandle) Lower

func (FfiConverterFfiCompletionHandle) Read

func (FfiConverterFfiCompletionHandle) Write

type FfiConverterMapStringString

type FfiConverterMapStringString struct{}

func (FfiConverterMapStringString) Lift

func (FfiConverterMapStringString) Lower

func (FfiConverterMapStringString) Read

func (_ FfiConverterMapStringString) Read(reader io.Reader) map[string]string

func (FfiConverterMapStringString) Write

func (_ FfiConverterMapStringString) Write(writer io.Writer, mapValue map[string]string)

type FfiConverterMessageContext

type FfiConverterMessageContext struct{}

func (FfiConverterMessageContext) Lift

func (FfiConverterMessageContext) Lower

func (FfiConverterMessageContext) Read

func (FfiConverterMessageContext) Write

func (c FfiConverterMessageContext) Write(writer io.Writer, value MessageContext)

type FfiConverterName

type FfiConverterName struct{}

func (FfiConverterName) Lift

func (c FfiConverterName) Lift(rb RustBufferI) Name

func (FfiConverterName) Lower

func (c FfiConverterName) Lower(value Name) C.RustBuffer

func (FfiConverterName) Read

func (c FfiConverterName) Read(reader io.Reader) Name

func (FfiConverterName) Write

func (c FfiConverterName) Write(writer io.Writer, value Name)

type FfiConverterOptionalBool

type FfiConverterOptionalBool struct{}

func (FfiConverterOptionalBool) Lift

func (FfiConverterOptionalBool) Lower

func (c FfiConverterOptionalBool) Lower(value *bool) C.RustBuffer

func (FfiConverterOptionalBool) Read

func (_ FfiConverterOptionalBool) Read(reader io.Reader) *bool

func (FfiConverterOptionalBool) Write

func (_ FfiConverterOptionalBool) Write(writer io.Writer, value *bool)

type FfiConverterOptionalMapStringString

type FfiConverterOptionalMapStringString struct{}

func (FfiConverterOptionalMapStringString) Lift

func (FfiConverterOptionalMapStringString) Lower

func (FfiConverterOptionalMapStringString) Read

func (FfiConverterOptionalMapStringString) Write

func (_ FfiConverterOptionalMapStringString) Write(writer io.Writer, value *map[string]string)

type FfiConverterOptionalName

type FfiConverterOptionalName struct{}

func (FfiConverterOptionalName) Lift

func (FfiConverterOptionalName) Lower

func (c FfiConverterOptionalName) Lower(value *Name) C.RustBuffer

func (FfiConverterOptionalName) Read

func (_ FfiConverterOptionalName) Read(reader io.Reader) *Name

func (FfiConverterOptionalName) Write

func (_ FfiConverterOptionalName) Write(writer io.Writer, value *Name)

type FfiConverterOptionalString

type FfiConverterOptionalString struct{}

func (FfiConverterOptionalString) Lift

func (FfiConverterOptionalString) Lower

func (FfiConverterOptionalString) Read

func (_ FfiConverterOptionalString) Read(reader io.Reader) *string

func (FfiConverterOptionalString) Write

func (_ FfiConverterOptionalString) Write(writer io.Writer, value *string)

type FfiConverterOptionalUint32

type FfiConverterOptionalUint32 struct{}

func (FfiConverterOptionalUint32) Lift

func (FfiConverterOptionalUint32) Lower

func (FfiConverterOptionalUint32) Read

func (_ FfiConverterOptionalUint32) Read(reader io.Reader) *uint32

func (FfiConverterOptionalUint32) Write

func (_ FfiConverterOptionalUint32) Write(writer io.Writer, value *uint32)

type FfiConverterOptionalUint64

type FfiConverterOptionalUint64 struct{}

func (FfiConverterOptionalUint64) Lift

func (FfiConverterOptionalUint64) Lower

func (FfiConverterOptionalUint64) Read

func (_ FfiConverterOptionalUint64) Read(reader io.Reader) *uint64

func (FfiConverterOptionalUint64) Write

func (_ FfiConverterOptionalUint64) Write(writer io.Writer, value *uint64)

type FfiConverterReceivedMessage

type FfiConverterReceivedMessage struct{}

func (FfiConverterReceivedMessage) Lift

func (FfiConverterReceivedMessage) Lower

func (FfiConverterReceivedMessage) Read

func (FfiConverterReceivedMessage) Write

func (c FfiConverterReceivedMessage) Write(writer io.Writer, value ReceivedMessage)

type FfiConverterSequenceString

type FfiConverterSequenceString struct{}

func (FfiConverterSequenceString) Lift

func (FfiConverterSequenceString) Lower

func (c FfiConverterSequenceString) Lower(value []string) C.RustBuffer

func (FfiConverterSequenceString) Read

func (c FfiConverterSequenceString) Read(reader io.Reader) []string

func (FfiConverterSequenceString) Write

func (c FfiConverterSequenceString) Write(writer io.Writer, value []string)

type FfiConverterServerConfig

type FfiConverterServerConfig struct{}

func (FfiConverterServerConfig) Lift

func (FfiConverterServerConfig) Lower

func (FfiConverterServerConfig) Read

func (FfiConverterServerConfig) Write

func (c FfiConverterServerConfig) Write(writer io.Writer, value ServerConfig)

type FfiConverterSessionConfig

type FfiConverterSessionConfig struct{}

func (FfiConverterSessionConfig) Lift

func (FfiConverterSessionConfig) Lower

func (FfiConverterSessionConfig) Read

func (FfiConverterSessionConfig) Write

func (c FfiConverterSessionConfig) Write(writer io.Writer, value SessionConfig)

type FfiConverterSessionType

type FfiConverterSessionType struct{}

func (FfiConverterSessionType) Lift

func (FfiConverterSessionType) Lower

func (FfiConverterSessionType) Read

func (FfiConverterSessionType) Write

func (FfiConverterSessionType) Write(writer io.Writer, value SessionType)

type FfiConverterSlimError

type FfiConverterSlimError struct{}

func (FfiConverterSlimError) Lift

func (FfiConverterSlimError) Lower

func (c FfiConverterSlimError) Lower(value *SlimError) C.RustBuffer

func (FfiConverterSlimError) Read

func (c FfiConverterSlimError) Read(reader io.Reader) *SlimError

func (FfiConverterSlimError) Write

func (c FfiConverterSlimError) Write(writer io.Writer, value *SlimError)

type FfiConverterString

type FfiConverterString struct{}

func (FfiConverterString) Lift

func (FfiConverterString) Lower

func (FfiConverterString) Lower(value string) C.RustBuffer

func (FfiConverterString) Read

func (FfiConverterString) Read(reader io.Reader) string

func (FfiConverterString) Write

func (FfiConverterString) Write(writer io.Writer, value string)

type FfiConverterTlsConfig

type FfiConverterTlsConfig struct{}

func (FfiConverterTlsConfig) Lift

func (FfiConverterTlsConfig) Lower

func (FfiConverterTlsConfig) Read

func (c FfiConverterTlsConfig) Read(reader io.Reader) TlsConfig

func (FfiConverterTlsConfig) Write

func (c FfiConverterTlsConfig) Write(writer io.Writer, value TlsConfig)

type FfiConverterUint32

type FfiConverterUint32 struct{}

func (FfiConverterUint32) Lift

func (FfiConverterUint32) Lift(value C.uint32_t) uint32

func (FfiConverterUint32) Lower

func (FfiConverterUint32) Lower(value uint32) C.uint32_t

func (FfiConverterUint32) Read

func (FfiConverterUint32) Read(reader io.Reader) uint32

func (FfiConverterUint32) Write

func (FfiConverterUint32) Write(writer io.Writer, value uint32)

type FfiConverterUint64

type FfiConverterUint64 struct{}

func (FfiConverterUint64) Lift

func (FfiConverterUint64) Lift(value C.uint64_t) uint64

func (FfiConverterUint64) Lower

func (FfiConverterUint64) Lower(value uint64) C.uint64_t

func (FfiConverterUint64) Read

func (FfiConverterUint64) Read(reader io.Reader) uint64

func (FfiConverterUint64) Write

func (FfiConverterUint64) Write(writer io.Writer, value uint64)

type FfiDestroyerBindingsAdapter

type FfiDestroyerBindingsAdapter struct{}

func (FfiDestroyerBindingsAdapter) Destroy

func (_ FfiDestroyerBindingsAdapter) Destroy(value *BindingsAdapter)

type FfiDestroyerBindingsSessionContext

type FfiDestroyerBindingsSessionContext struct{}

func (FfiDestroyerBindingsSessionContext) Destroy

type FfiDestroyerBool

type FfiDestroyerBool struct{}

func (FfiDestroyerBool) Destroy

func (FfiDestroyerBool) Destroy(_ bool)

type FfiDestroyerBuildInfo

type FfiDestroyerBuildInfo struct{}

func (FfiDestroyerBuildInfo) Destroy

func (_ FfiDestroyerBuildInfo) Destroy(value BuildInfo)

type FfiDestroyerBytes

type FfiDestroyerBytes struct{}

func (FfiDestroyerBytes) Destroy

func (FfiDestroyerBytes) Destroy(_ []byte)

type FfiDestroyerClientConfig

type FfiDestroyerClientConfig struct{}

func (FfiDestroyerClientConfig) Destroy

func (_ FfiDestroyerClientConfig) Destroy(value ClientConfig)

type FfiDestroyerDuration

type FfiDestroyerDuration struct{}

func (FfiDestroyerDuration) Destroy

func (FfiDestroyerDuration) Destroy(_ time.Duration)

type FfiDestroyerFfiCompletionHandle

type FfiDestroyerFfiCompletionHandle struct{}

func (FfiDestroyerFfiCompletionHandle) Destroy

type FfiDestroyerMapStringString

type FfiDestroyerMapStringString struct{}

func (FfiDestroyerMapStringString) Destroy

func (_ FfiDestroyerMapStringString) Destroy(mapValue map[string]string)

type FfiDestroyerMessageContext

type FfiDestroyerMessageContext struct{}

func (FfiDestroyerMessageContext) Destroy

func (_ FfiDestroyerMessageContext) Destroy(value MessageContext)

type FfiDestroyerName

type FfiDestroyerName struct{}

func (FfiDestroyerName) Destroy

func (_ FfiDestroyerName) Destroy(value Name)

type FfiDestroyerOptionalBool

type FfiDestroyerOptionalBool struct{}

func (FfiDestroyerOptionalBool) Destroy

func (_ FfiDestroyerOptionalBool) Destroy(value *bool)

type FfiDestroyerOptionalMapStringString

type FfiDestroyerOptionalMapStringString struct{}

func (FfiDestroyerOptionalMapStringString) Destroy

func (_ FfiDestroyerOptionalMapStringString) Destroy(value *map[string]string)

type FfiDestroyerOptionalName

type FfiDestroyerOptionalName struct{}

func (FfiDestroyerOptionalName) Destroy

func (_ FfiDestroyerOptionalName) Destroy(value *Name)

type FfiDestroyerOptionalString

type FfiDestroyerOptionalString struct{}

func (FfiDestroyerOptionalString) Destroy

func (_ FfiDestroyerOptionalString) Destroy(value *string)

type FfiDestroyerOptionalUint32

type FfiDestroyerOptionalUint32 struct{}

func (FfiDestroyerOptionalUint32) Destroy

func (_ FfiDestroyerOptionalUint32) Destroy(value *uint32)

type FfiDestroyerOptionalUint64

type FfiDestroyerOptionalUint64 struct{}

func (FfiDestroyerOptionalUint64) Destroy

func (_ FfiDestroyerOptionalUint64) Destroy(value *uint64)

type FfiDestroyerReceivedMessage

type FfiDestroyerReceivedMessage struct{}

func (FfiDestroyerReceivedMessage) Destroy

type FfiDestroyerSequenceString

type FfiDestroyerSequenceString struct{}

func (FfiDestroyerSequenceString) Destroy

func (FfiDestroyerSequenceString) Destroy(sequence []string)

type FfiDestroyerServerConfig

type FfiDestroyerServerConfig struct{}

func (FfiDestroyerServerConfig) Destroy

func (_ FfiDestroyerServerConfig) Destroy(value ServerConfig)

type FfiDestroyerSessionConfig

type FfiDestroyerSessionConfig struct{}

func (FfiDestroyerSessionConfig) Destroy

func (_ FfiDestroyerSessionConfig) Destroy(value SessionConfig)

type FfiDestroyerSessionType

type FfiDestroyerSessionType struct{}

func (FfiDestroyerSessionType) Destroy

func (_ FfiDestroyerSessionType) Destroy(value SessionType)

type FfiDestroyerSlimError

type FfiDestroyerSlimError struct{}

func (FfiDestroyerSlimError) Destroy

func (_ FfiDestroyerSlimError) Destroy(value *SlimError)

type FfiDestroyerString

type FfiDestroyerString struct{}

func (FfiDestroyerString) Destroy

func (FfiDestroyerString) Destroy(_ string)

type FfiDestroyerTlsConfig

type FfiDestroyerTlsConfig struct{}

func (FfiDestroyerTlsConfig) Destroy

func (_ FfiDestroyerTlsConfig) Destroy(value TlsConfig)

type FfiDestroyerUint32

type FfiDestroyerUint32 struct{}

func (FfiDestroyerUint32) Destroy

func (FfiDestroyerUint32) Destroy(_ uint32)

type FfiDestroyerUint64

type FfiDestroyerUint64 struct{}

func (FfiDestroyerUint64) Destroy

func (FfiDestroyerUint64) Destroy(_ uint64)

type FfiObject

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

type GoRustBuffer

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

This is needed, because as of go 1.24 type RustBuffer C.RustBuffer cannot have methods, RustBuffer is treated as non-local type

func RustBufferFromExternal

func RustBufferFromExternal(b RustBufferI) GoRustBuffer

func (GoRustBuffer) AsReader

func (cb GoRustBuffer) AsReader() *bytes.Reader

func (GoRustBuffer) Capacity

func (cb GoRustBuffer) Capacity() uint64

func (GoRustBuffer) Data

func (cb GoRustBuffer) Data() unsafe.Pointer

func (GoRustBuffer) Free

func (cb GoRustBuffer) Free()

func (GoRustBuffer) Len

func (cb GoRustBuffer) Len() uint64

func (GoRustBuffer) ToGoBytes

func (cb GoRustBuffer) ToGoBytes() []byte

type MessageContext

type MessageContext struct {
	// Fully-qualified sender identity
	SourceName Name
	// Fully-qualified destination identity (may be empty for broadcast/group scenarios)
	DestinationName *Name
	// Logical/semantic type (defaults to "msg" if unspecified)
	PayloadType string
	// Arbitrary key/value pairs supplied by the sender (e.g. tracing IDs)
	Metadata map[string]string
	// Numeric identifier of the inbound connection carrying the message
	InputConnection uint64
	// Identity contained in the message
	Identity string
}

Generic message context for language bindings (UniFFI-compatible)

Provides routing and descriptive metadata needed for replying, auditing, and instrumentation across different language bindings. This type is exported to foreign languages via UniFFI.

func (*MessageContext) Destroy

func (r *MessageContext) Destroy()

type Name

type Name struct {
	Components []string
	Id         *uint64
}

Name type for SLIM (Secure Low-Latency Interactive Messaging)

func (*Name) Destroy

func (r *Name) Destroy()

type NativeError

type NativeError interface {
	AsError() error
}

type ReceivedMessage

type ReceivedMessage struct {
	Context MessageContext
	Payload []byte
}

Received message containing context and payload

func (*ReceivedMessage) Destroy

func (r *ReceivedMessage) Destroy()

type RustBufferI

type RustBufferI interface {
	AsReader() *bytes.Reader
	Free()
	ToGoBytes() []byte
	Data() unsafe.Pointer
	Len() uint64
	Capacity() uint64
}

type ServerConfig

type ServerConfig struct {
	Endpoint string
	Tls      TlsConfig
}

Server configuration for running a SLIM server

func (*ServerConfig) Destroy

func (r *ServerConfig) Destroy()

type SessionConfig

type SessionConfig struct {
	// Session type (PointToPoint or Group)
	SessionType SessionType
	// Enable MLS encryption for this session
	EnableMls bool
	// Maximum number of retries for message transmission (None = use default)
	MaxRetries *uint32
	// Interval between retries in milliseconds (None = use default)
	IntervalMs *uint64
	// Whether this endpoint is the session initiator
	Initiator bool
	// Custom metadata key-value pairs for the session
	Metadata map[string]string
}

Session configuration

func (*SessionConfig) Destroy

func (r *SessionConfig) Destroy()

type SessionType

type SessionType uint

Session type enum

const (
	SessionTypePointToPoint SessionType = 1
	SessionTypeGroup        SessionType = 2
)

type SlimError

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

Error types for SLIM operations

func NewSlimErrorAuthError

func NewSlimErrorAuthError(
	message string,
) *SlimError

func NewSlimErrorInternalError

func NewSlimErrorInternalError(
	message string,
) *SlimError

func NewSlimErrorInvalidArgument

func NewSlimErrorInvalidArgument(
	message string,
) *SlimError

func NewSlimErrorReceiveError

func NewSlimErrorReceiveError(
	message string,
) *SlimError

func NewSlimErrorSendError

func NewSlimErrorSendError(
	message string,
) *SlimError

func NewSlimErrorServiceError

func NewSlimErrorServiceError(
	message string,
) *SlimError

func NewSlimErrorSessionError

func NewSlimErrorSessionError(
	message string,
) *SlimError

func NewSlimErrorTimeout

func NewSlimErrorTimeout() *SlimError

func (*SlimError) AsError

func (err *SlimError) AsError() error

Convience method to turn *SlimError into error Avoiding treating nil pointer as non nil error interface

func (SlimError) Error

func (err SlimError) Error() string

func (SlimError) Unwrap

func (err SlimError) Unwrap() error

type SlimErrorAuthError

type SlimErrorAuthError struct {
	Message string
}

func (SlimErrorAuthError) Error

func (err SlimErrorAuthError) Error() string

func (SlimErrorAuthError) Is

func (self SlimErrorAuthError) Is(target error) bool

type SlimErrorInternalError

type SlimErrorInternalError struct {
	Message string
}

func (SlimErrorInternalError) Error

func (err SlimErrorInternalError) Error() string

func (SlimErrorInternalError) Is

func (self SlimErrorInternalError) Is(target error) bool

type SlimErrorInvalidArgument

type SlimErrorInvalidArgument struct {
	Message string
}

func (SlimErrorInvalidArgument) Error

func (err SlimErrorInvalidArgument) Error() string

func (SlimErrorInvalidArgument) Is

func (self SlimErrorInvalidArgument) Is(target error) bool

type SlimErrorReceiveError

type SlimErrorReceiveError struct {
	Message string
}

func (SlimErrorReceiveError) Error

func (err SlimErrorReceiveError) Error() string

func (SlimErrorReceiveError) Is

func (self SlimErrorReceiveError) Is(target error) bool

type SlimErrorSendError

type SlimErrorSendError struct {
	Message string
}

func (SlimErrorSendError) Error

func (err SlimErrorSendError) Error() string

func (SlimErrorSendError) Is

func (self SlimErrorSendError) Is(target error) bool

type SlimErrorServiceError

type SlimErrorServiceError struct {
	Message string
}

Variant structs

func (SlimErrorServiceError) Error

func (err SlimErrorServiceError) Error() string

func (SlimErrorServiceError) Is

func (self SlimErrorServiceError) Is(target error) bool

type SlimErrorSessionError

type SlimErrorSessionError struct {
	Message string
}

func (SlimErrorSessionError) Error

func (err SlimErrorSessionError) Error() string

func (SlimErrorSessionError) Is

func (self SlimErrorSessionError) Is(target error) bool

type SlimErrorTimeout

type SlimErrorTimeout struct {
}

func (SlimErrorTimeout) Error

func (err SlimErrorTimeout) Error() string

func (SlimErrorTimeout) Is

func (self SlimErrorTimeout) Is(target error) bool

type TlsConfig

type TlsConfig struct {
	// Disable TLS entirely (plain text connection)
	Insecure bool
	// Skip server certificate verification (client only, enables TLS but doesn't verify certs)
	// WARNING: Only use for testing - insecure in production!
	InsecureSkipVerify *bool
	// Path to certificate file (PEM format)
	CertFile *string
	// Path to private key file (PEM format)
	KeyFile *string
	// Path to CA certificate file (PEM format) for verifying peer certificates
	CaFile *string
	// TLS version to use: "tls1.2" or "tls1.3" (default: "tls1.3")
	TlsVersion *string
	// Include system CA certificates pool (default: false)
	IncludeSystemCaCertsPool *bool
}

TLS configuration for server/client

func (*TlsConfig) Destroy

func (r *TlsConfig) Destroy()

Directories

Path Synopsis
cmd
slim-bindings-setup command
slim-bindings-setup downloads and installs the SLIM bindings native library.
slim-bindings-setup downloads and installs the SLIM bindings native library.