Greenfield Go multi-tenant IPFS Pinning Service wire-compatible with the
IPFS Pinning Services API spec. Paired 1:1 with Kubo over localhost RPC,
clustered via embedded NATS JetStream, Postgres source-of-truth with
RLS-enforced tenancy, Fiber + huma v2 for the HTTP surface, Authentik
OIDC for session login with kid-rotated HS256 JWT API tokens.
Feature-complete against the 22-milestone build plan, including the
ship-it v1.0 gap items:
* admin CLIs: drain/uncordon, maintenance, mint-token, rotate-key,
prune-denylist, rebalance --dry-run, cache-stats, cluster-presences
* TTL leader election via NATS KV, fence tokens, JetStream dedup
* rebalancer (plan/apply split), reconciler, requeue sweeper
* ristretto caches with NATS-backed cross-node invalidation
(placements live-nodes + token denylist)
* maintenance watchdog for stuck cluster-pause flag
* Prometheus /metrics with CIDR ACL, HTTP/pin/scheduler/cache gauges
* rate limiting: session (10/min) + anonymous global (120/min)
* integration tests: rebalance, refcount multi-org, RLS belt
* goreleaser (tar + deb/rpm/apk + Alpine Docker) targeting Gitea
Stack: Cobra/Viper, Fiber v2 + huma v2, embedded NATS JetStream,
pgx/sqlc/golang-migrate, ristretto, TypeID, prometheus/client_golang,
testcontainers-go.
111 lines
2.1 KiB
Go
111 lines
2.1 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
|
|
package sqlc
|
|
|
|
import (
|
|
"anchorage/internal/pkg/ids"
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
type ApiToken struct {
|
|
Jti ids.TokenID
|
|
OrgID ids.OrgID
|
|
UserID ids.UserID
|
|
Label string
|
|
Scopes []string
|
|
ExpiresAt pgtype.Timestamptz
|
|
RevokedAt pgtype.Timestamptz
|
|
LastUsedAt pgtype.Timestamptz
|
|
CreatedAt pgtype.Timestamptz
|
|
UpdatedAt pgtype.Timestamptz
|
|
}
|
|
|
|
type AuditLog struct {
|
|
ID int64
|
|
OrgID ids.OrgID
|
|
ActorUserID ids.UserID
|
|
ActorTokenJti *string
|
|
Action string
|
|
Target string
|
|
Result string
|
|
Detail []byte
|
|
Created pgtype.Timestamptz
|
|
}
|
|
|
|
type Membership struct {
|
|
OrgID ids.OrgID
|
|
UserID ids.UserID
|
|
Role string
|
|
CreatedAt pgtype.Timestamptz
|
|
UpdatedAt pgtype.Timestamptz
|
|
}
|
|
|
|
type Node struct {
|
|
ID ids.NodeID
|
|
DisplayName string
|
|
Multiaddrs []string
|
|
RpcUrl string
|
|
Status string
|
|
LastSeenAt pgtype.Timestamptz
|
|
JoinedAt pgtype.Timestamptz
|
|
UpdatedAt pgtype.Timestamptz
|
|
}
|
|
|
|
type Org struct {
|
|
ID ids.OrgID
|
|
Slug string
|
|
Name string
|
|
CreatedAt pgtype.Timestamptz
|
|
UpdatedAt pgtype.Timestamptz
|
|
}
|
|
|
|
type Pin struct {
|
|
RequestID ids.PinID
|
|
OrgID ids.OrgID
|
|
Cid string
|
|
Name *string
|
|
Meta []byte
|
|
Origins []string
|
|
Status string
|
|
FailureReason *string
|
|
Created pgtype.Timestamptz
|
|
UpdatedAt pgtype.Timestamptz
|
|
}
|
|
|
|
type PinPlacement struct {
|
|
RequestID ids.PinID
|
|
NodeID ids.NodeID
|
|
Status string
|
|
FailureReason *string
|
|
Attempts int32
|
|
Fence int64
|
|
CreatedAt pgtype.Timestamptz
|
|
UpdatedAt pgtype.Timestamptz
|
|
}
|
|
|
|
type PinRefcount struct {
|
|
NodeID ids.NodeID
|
|
Cid string
|
|
Count int32
|
|
UpdatedAt pgtype.Timestamptz
|
|
}
|
|
|
|
type TokenDenylist struct {
|
|
Jti string
|
|
ExpiresAt pgtype.Timestamptz
|
|
Reason string
|
|
CreatedAt pgtype.Timestamptz
|
|
}
|
|
|
|
type User struct {
|
|
ID ids.UserID
|
|
AuthentikSub *string
|
|
Email string
|
|
DisplayName string
|
|
IsSysadmin bool
|
|
CreatedAt pgtype.Timestamptz
|
|
UpdatedAt pgtype.Timestamptz
|
|
}
|