core

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0, MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package core is the only package that speaks gRPC to the wamux daemon. It knows nothing about WAHA: it hands out the generated service clients and turns a gRPC status into an *Error the rest of the edge can branch on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodeOf

func CodeOf(err error) codes.Code

CodeOf is the gRPC code of err: OK for nil, Unknown for an error that did not come from the core.

Types

type Client

type Client struct {
	Accounts    pb.AccountServiceClient
	Messaging   pb.MessagingServiceClient
	Events      pb.EventServiceClient
	Contacts    pb.ContactServiceClient
	Groups      pb.GroupServiceClient
	Media       pb.MediaServiceClient
	Newsletters pb.NewsletterServiceClient
	Calls       pb.CallServiceClient
	Admin       pb.AdminServiceClient
	// contains filtered or unexported fields
}

Client bundles one connection to the core's socket and every service on it.

func Dial

func Dial(socketPath string) (*Client, error)

Dial connects to the core's Unix socket. The connection is lazy: a missing socket shows up as Unavailable on the first call, not here, so the edge can start before the core does.

func (*Client) Close

func (c *Client) Close() error

Close releases the connection.

type Error

type Error struct {
	Code    codes.Code
	Message string
	WACode  string
	WAText  string
}

Error is a failed core call. WACode and WAText are the WhatsApp server's own verdict when the core relayed one (the wa-code / wa-text trailers), empty when the failure was the core's or the transport's.

func AsError

func AsError(err error) (*Error, bool)

AsError unwraps an *Error from err.

func (*Error) Error

func (e *Error) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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