file

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package file 是单租户存储:一份 hosts.json,没有账号。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

func Open

func Open(path string) (*Store, error)

func (*Store) AccountByToken

func (s *Store) AccountByToken(string) (*store.Account, error)

func (*Store) AddBytes

func (s *Store) AddBytes(accountID string, n int64)

func (*Store) AddPushes

func (s *Store) AddPushes(accountID string, n int)

func (*Store) ApproveDeviceCode

func (s *Store) ApproveDeviceCode(string, string) error

func (*Store) AuthenticateV1

func (s *Store) AuthenticateV1(id, name, tokenHash string, online bool) (*store.Host, error)

func (*Store) AuthenticateV2

func (s *Store) AuthenticateV2(id, name string, pub []byte, online, tofu, replaceWhenOffline bool) (*store.Host, error)

func (*Store) Ban

func (s *Store) Ban(id string, banned bool) error

func (*Store) ConsumeDeviceCode

func (s *Store) ConsumeDeviceCode(string) (*store.Account, string, error)

func (*Store) Count

func (s *Store) Count() int

func (*Store) CreateCLIToken

func (s *Store) CreateCLIToken(string) (string, error)

func (*Store) CreateDeviceCode

func (s *Store) CreateDeviceCode(string, string, time.Duration) (*store.DeviceCode, error)

func (*Store) Flush

func (s *Store) Flush() error

func (*Store) ListHosts

func (s *Store) ListHosts(string) ([]*store.Host, error)

func (*Store) Lookup

func (s *Store) Lookup(id string) (*store.Host, bool)

func (*Store) LookupDeviceCode

func (s *Store) LookupDeviceCode(string) (*store.DeviceCode, error)

func (*Store) LookupUserCode

func (s *Store) LookupUserCode(string) (*store.DeviceCode, error)

func (*Store) QuotaFor

func (s *Store) QuotaFor(string) store.Quota

func (*Store) RegisterHost

func (s *Store) RegisterHost(_, id, name string, pub []byte, bundleID string) (*store.Host, error)

func (*Store) RotateEd25519

func (s *Store) RotateEd25519(id string, pub []byte) error

func (*Store) SetNode

func (s *Store) SetNode(id, nodeID string) error

func (*Store) SetQuotaDefaults

func (s *Store) SetQuotaDefaults(q store.Quota)

func (*Store) TouchSeen

func (s *Store) TouchSeen(id, name string) error

func (*Store) UpsertAccount

func (s *Store) UpsertAccount(string, string, string) (*store.Account, error)

Jump to

Keyboard shortcuts

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