> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wipe.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Go SDK

> Use Wipe.me from command-line applications, backend services, and compiled tools.

Module: `github.com/wipe-me/sdk/go`\
Current prerelease: `v0.5.0-alpha.1`
Monorepo tag: `go/v0.5.0-alpha.1`
Source: [Go SDK](https://github.com/wipe-me/sdk/tree/main/go)

```bash theme={null}
go get github.com/wipe-me/sdk/go@v0.5.0-alpha.1
go list -m github.com/wipe-me/sdk/go@v0.5.0-alpha.1
```

## Encrypt and create

```go theme={null}
var envelope bytes.Buffer

messageID, err := wipeme.GenerateMessageID()
secret, err := wipeme.GenerateSecret()
encrypted, err := wipeme.Encrypt(
    &envelope,
    messageID,
    secret,
    "Private hello",
    []wipeme.AttachmentInput{{
        Reader: bytes.NewReader(fileBytes),
        Name:   "note.txt",
        Type:   "text/plain",
        Kind:   "text",
        Size:   int64(len(fileBytes)),
    }},
)

client, err := wipeme.NewClient(wipeme.ClientOptions{ClientID: "my-app"})
created, err := client.CreateMessage(ctx, wipeme.CreateMessageRequest{
    MessageID:   messageID,
    Envelope:    envelope.Bytes(),
    ContentHash: encrypted.ContentHash,
    DeletionKey: encrypted.DeletionKeyHeader,
    ExpiresAt:   time.Now().Add(24 * time.Hour),
})
```

## Retrieve, decrypt, and delete

```go theme={null}
downloaded, err := client.RetrieveMessage(ctx, messageID)
opened, err := wipeme.Decrypt(
    bytes.NewReader(downloaded.Envelope),
    messageID,
    secret,
)
deleted, err := client.DeleteMessage(
    ctx,
    messageID,
    opened.DeletionKeyHeader,
)
```

Attachments stream into encryption. The client also exposes progress callbacks,
private-link helpers, health and effective-limit operations, bounded network tests,
and privacy-safe performance reporting.

Non-2xx responses return `*wipeme.APIError`, compatible with `errors.As`, with
`StatusCode`, stable `Code`, human-readable `Message`, and `RetryAfter` seconds.

<Warning>
  The fragment secret must remain local and never be sent to the API. Retrieval is
  atomic and one-time. Treat authentication, integrity, and content-hash failures as
  fatal.
</Warning>

See the [Go source and README](https://github.com/wipe-me/sdk/tree/main/go) for the
complete public API and option types.
