businnect

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 7 Imported by: 0

README ¶

Businnect Go SDK

A professional Go client for the businnect API, featuring high-performance support for Microposts.

📖 API Documentation

For detailed information on the underlying REST API, endpoints, and authentication schemas, please visit the official documentation:

Features

  • Micropost System: Create text posts or file-based updates with community-specific targeting.
  • Context Support: Full context.Context support for timeouts and cancellations in every request.

Installation

go get github.com/BusinnectCode/businnect_go

Quick Start

Initialize the Client

The client can be initialized with an explicit API key or automatically look for environment variables.

import "github.com/BusinnectCode/businnect_go"

func main() {
    // Pass the API key and Base URL
    client := businnect.NewClient("your-api-token", "https://api.businnect.com")
}

Create a Micropost

Easily create posts with optional titles and bodies.

title := "New Update"
req := resources.CreateMicropostRequest{
    Title: &title,
    Body:  "The Go SDK is now live!",
}

resp, err := client.Micropost.Create(context.Background(), req)
if err != nil {
    panic(err)
}
fmt.Printf("Post created with ID: %s\n", resp.PublicID)

Environment Variables

The SDK can utilize the following environment variables for testing or default configuration:

  • BUSINNECT_API_TOKEN: Used by integration tests to authenticate against the live API.

Testing

Run the test suite using the standard Go toolchain:

# In PowerShell
$env:BUSINNECT_API_TOKEN="your-token"; go test -v ./...

# In Bash
BUSINNECT_API_TOKEN="your-token" go test -v ./...

Documentation ¶

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

This section is empty.

Types ¶

type Client ¶

type Client struct {
	Micropost *resources.MicropostResource
	AdminBlog *resources.AdminBlogResource
	// contains filtered or unexported fields
}

func NewClient ¶

func NewClient(apiKey string, baseURL string) *Client

func (*Client) Do ¶

func (c *Client) Do(req *http.Request) (io.ReadCloser, error)

Directories ¶

Path Synopsis

Jump to

Keyboard shortcuts

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