Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/sourcey-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Sourcey Docs

on:
pull_request:
paths:
- '.github/workflows/sourcey-docs.yml'
- 'docs/sourcey/**'
- '**/*.go'
- 'go.mod'
- 'v2/go.mod'
push:
branches: [master]
paths:
- '.github/workflows/sourcey-docs.yml'
- 'docs/sourcey/**'
- '**/*.go'
- 'go.mod'
- 'v2/go.mod'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: sourcey-docs-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.x'
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
cache-dependency-path: docs/sourcey/package-lock.json
- name: Install pinned dependencies
run: npm ci
working-directory: docs/sourcey
- name: Build Sourcey site
run: npm run build
working-directory: docs/sourcey
- name: Upload documentation artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v4
with:
path: docs/sourcey/dist

deploy:
name: Deploy documentation
if: github.event_name != 'pull_request'
needs: build
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions docs/sourcey/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
25 changes: 25 additions & 0 deletions docs/sourcey/choosing-a-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Choosing a version
description: Decide whether to use the go-car v2 module or the original v1 module.
---

## Use v2 for new work

Import packages beneath `github.com/ipld/go-car/v2` when starting a new
integration. The v2 module exposes CARv1 and CARv2 reading and writing,
indexing, blockstore integration, and random-access storage APIs.

Pin a released module version in `go.mod`; do not infer compatibility from this
documentation site's build date.

## Keep v1 where compatibility requires it

The original module path is `github.com/ipld/go-car`. It remains useful when an
existing dependency graph or API contract is based on v1. Its API reference is
kept in a separate tab so similarly named symbols cannot be confused with v2.

## Verify behavior at the source

The generated reference reflects one pinned upstream commit. Before upgrading,
read the upstream release notes and run your application's tests against the
specific module version selected in `go.mod`.
35 changes: 35 additions & 0 deletions docs/sourcey/common-workflows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Common workflows
description: Find the relevant go-car v2 packages for reading, writing, indexing, and storage.
---

## Read a CAR stream

Start in the v2 root package for CAR header inspection and sequential block
reading. Use the API search for `NewBlockReader` and inspect the source-derived
examples beside the related types.

## Write or wrap content

The v2 root package contains writers and options for producing CAR data. Choose
options deliberately: padding, index characteristics, and data layout affect
interoperability and random access.

## Build and use indexes

Use the `index` package to inspect available index codecs and construct or read
an index. The `indexstore` package connects index storage to higher-level
workflows.

## Use CAR files as block storage

Look under `blockstore` and `storage` in the v2 API. Their package docs and
examples explain the contracts for read-only, read-write, and random-access
use. Treat filesystem paths and external readers as caller-controlled resources
and close them according to the documented API contract.

## Validate before deployment

Test with representative archives, including empty, partial, and large samples.
Set application-level limits for file size, block count, memory use, and I/O
time according to the workload being served.
26 changes: 26 additions & 0 deletions docs/sourcey/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: go-car documentation
description: Guides and searchable API references for the IPLD CAR v1 and v2 Go modules.
---

`go-car` reads, writes, indexes, and inspects Content Addressable aRchive (CAR)
files in Go. This site combines practical entry points with API references
generated directly from the repository's Go source and examples.

## What is covered

- The current `github.com/ipld/go-car/v2` module, including its index and
storage packages.
- The original `github.com/ipld/go-car` module for applications that still use
the v1 API.
- Exported functions, types, methods, constants, variables, fields, examples,
and package documentation found in the pinned source tree.

## Start here

New applications should normally begin with the **v2 API** tab. Read
**Choosing a version** before changing an existing integration, because the v1
and v2 module paths and APIs are intentionally distinct.

The canonical source, issue tracker, change history, and release notes remain in
the [upstream repository](https://github.com/ipld/go-car).
Loading
Loading