Versions in this module Expand all Collapse all v0 v0.3.0 Nov 27, 2026 Changes in this version + var ErrExpired = errors.New("join token has expired") + var ErrInvalid = errors.New("join token is not valid") + var ErrUsed = errors.New("join token has no use left") + func ID(token string) (string, bool) + type KV interface + KVCreate func(ctx context.Context, bucket string, key string, value []byte) (uint64, error) + KVDelete func(ctx context.Context, bucket string, key string) error + KVGet func(ctx context.Context, bucket string, key string) (jetstream.KeyValueEntry, error) + KVKeys func(ctx context.Context, bucket string, filters ...string) ([]string, error) + KVUpdate func(ctx context.Context, bucket string, key string, value []byte, revision uint64) (uint64, error) + type Store struct + Bucket string + KV KV + Now func() time.Time + func (s Store) Check(ctx context.Context, token string) (Token, error) + func (s Store) Consume(ctx context.Context, token string) (Token, error) + func (s Store) Create(ctx context.Context, expires time.Duration, uses int, labels map[string]string) (string, Token, error) + func (s Store) List(ctx context.Context) ([]Token, error) + func (s Store) Revoke(ctx context.Context, id string) error + type Token struct + CreatedAt time.Time + ExpiresAt time.Time + Hash string + ID string + Labels map[string]string + UsesLeft int