Help us shape the future of Go! Take the 2026 Go Developer Survey

sealclub

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

README

sealclub

Thin Go client for seal.club.

go get github.com/sealdotclub/go-sdk
export SEAL_API_KEY=sk_test_...
package main

import (
	"os"

	sealclub "github.com/sealdotclub/go-sdk"
)

func main() {
	client, err := sealclub.FromEnv()
	if err != nil {
		panic(err)
	}
	pdf, err := os.ReadFile("doc.pdf")
	if err != nil {
		panic(err)
	}
	sealed, err := client.Seal(pdf)
	if err != nil {
		panic(err)
	}
	if err := os.WriteFile("doc.sealed.pdf", sealed, 0o644); err != nil {
		panic(err)
	}
}

Optional: SEAL_API_BASE_URL (default https://api.seal.club).

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://api.seal.club"

DefaultBaseURL is the production API base URL.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	APIKey     string
	BaseURL    string
	HTTPClient *http.Client
}

Client is a minimal seal.club API client: POST raw PDF bytes to /seal.

func FromEnv

func FromEnv() (*Client, error)

FromEnv builds a client from SEAL_API_KEY and optional SEAL_API_BASE_URL.

func FromEnvMap

func FromEnvMap(env map[string]string) (*Client, error)

FromEnvMap is like FromEnv but reads from the given map instead of the process environment.

func New

func New(apiKey, baseURL string) *Client

New creates a client. Empty apiKey skips auth headers. Empty baseURL uses DefaultBaseURL.

func (*Client) Seal

func (c *Client) Seal(pdf []byte) ([]byte, error)

Seal posts PDF bytes to /seal and returns the sealed PDF.

func (*Client) SealContext

func (c *Client) SealContext(ctx context.Context, pdf []byte) ([]byte, error)

SealContext is Seal with a caller-provided context.

type Error

type Error struct {
	Status int
	Detail string
}

Error is a seal.club API or client error.

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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