Documentation ¶
Index ¶
- Constants
- func Clone(ctx context.Context, u goturl.SpaceURL, dirPath string) error
- func ConfigureRepo(repoPath string, fn func(x Config) Config) error
- func Init(p string) error
- func LoadPrivateKey(fsx posixfs.FS, p string) (p2p.PrivateKey, error)
- func MarshalIAMPolicy(p gotiam.Policy) []byte
- func MarshalIAMRule(r gotiam.Rule) []byte
- func ParsePolicy(data []byte) (*gotiam.Policy, error)
- func ParseRule(data []byte) (*gotiam.Rule, error)
- func SaveConfig(fsx posixfs.FS, p string, c Config) error
- func SavePrivateKey(fsx posixfs.FS, p string, privateKey p2p.PrivateKey) error
- type Branch
- type BranchSpec
- type Cell
- type CellID
- type CellSpec
- type Config
- type CryptoSpaceSpec
- type EncryptedCellSpec
- type FS
- type FileOperation
- type GRPCSpaceSpec
- type HTTPCellSpec
- type LocalCellSpec
- type LocalStoreSpec
- type MultiSpaceSpec
- type PeerCellSpec
- type PeerID
- type PrefixSpaceSpec
- type PrivateKey
- type QUICSpaceSpec
- type Ref
- type Repo
- func (r *Repo) Add(ctx context.Context, paths ...string) error
- func (r *Repo) Cat(ctx context.Context, p string, w io.Writer) error
- func (r *Repo) Check(ctx context.Context) error
- func (r *Repo) CleanupBranch(ctx context.Context, name string) error
- func (r *Repo) Clear(ctx context.Context) error
- func (r *Repo) Close() error
- func (r *Repo) Commit(ctx context.Context, snapInfo gotvc.SnapInfo) error
- func (r *Repo) CreateBranch(ctx context.Context, name string, params branches.Metadata) (*Branch, error)
- func (r *Repo) CreateBranchWithSpec(name string, spec BranchSpec) (*Branch, error)
- func (r *Repo) DebugDB(ctx context.Context, w io.Writer) error
- func (r *Repo) DebugFS(ctx context.Context, w io.Writer) error
- func (r *Repo) DebugKV(ctx context.Context, w io.Writer) error
- func (r *Repo) DeleteBranch(ctx context.Context, name string) error
- func (r *Repo) Discard(ctx context.Context, paths ...string) error
- func (r *Repo) ForEachBranch(ctx context.Context, fn func(string) error) error
- func (r *Repo) ForEachStaging(ctx context.Context, fn func(p string, op FileOperation) error) error
- func (r *Repo) ForEachUntracked(ctx context.Context, fn func(p string) error) error
- func (r *Repo) Fork(ctx context.Context, base, next string) error
- func (r *Repo) GetActiveBranch(ctx context.Context) (string, *Branch, error)
- func (r *Repo) GetBranch(ctx context.Context, name string) (*Branch, error)
- func (r *Repo) GetBranchHead(ctx context.Context, name string) (*Snap, error)
- func (r *Repo) GetIAMPolicy() gotiam.Policy
- func (r *Repo) GetID() inet256.Addr
- func (r *Repo) GetImportStores(ctx context.Context, branchName string) (*branches.StoreTriple, error)
- func (r *Repo) GetNativeURL() goturl.SpaceURL
- func (r *Repo) GetPrivateKey() p2p.PrivateKey
- func (r *Repo) GetSpace() Space
- func (r *Repo) GotNetClient() (*gotnet.Service, error)
- func (r *Repo) History(ctx context.Context, name string, fn func(ref Ref, s Snap) error) error
- func (r *Repo) Ls(ctx context.Context, p string, fn func(gotfs.DirEnt) error) error
- func (r *Repo) MakeCell(spec CellSpec) (Cell, error)
- func (r *Repo) MakeSpace(spec SpaceSpec) (Space, error)
- func (r *Repo) MakeStore(spec StoreSpec) (Store, error)
- func (r *Repo) MakeVolume(spec VolumeSpec) (*Volume, error)
- func (r *Repo) Put(ctx context.Context, paths ...string) error
- func (r *Repo) Rm(ctx context.Context, paths ...string) error
- func (r *Repo) Serve(ctx context.Context) error
- func (r *Repo) ServeQUIC(ctx context.Context, laddr string) error
- func (r *Repo) SetActiveBranch(ctx context.Context, name string) error
- func (r *Repo) SetBranch(ctx context.Context, name string, md branches.Metadata) error
- func (r *Repo) SetBranchHead(ctx context.Context, name string, snap Snap) error
- func (r *Repo) Stat(ctx context.Context, p string) (*gotfs.Info, error)
- func (r *Repo) Sync(ctx context.Context, src, dst string, force bool) error
- func (r *Repo) UnionStore() cadata.Store
- func (r *Repo) UpdateIAMPolicy(fn func(gotiam.Policy) gotiam.Policy) error
- func (r *Repo) WorkingDir() FS
- type Root
- type SignedCellSpec
- type Snap
- type Space
- type SpaceLayerSpec
- type SpaceSpec
- type Store
- type StoreID
- type StoreSpec
- type Volume
- type VolumeSpec
Constants ¶
const ( MaxBlobSize = gotfs.DefaultMaxBlobSize MaxCellSize = 1 << 16 )
Variables ¶
This section is empty.
Functions ¶
func Clone ¶ added in v0.0.3
Clone creates a new Repo at dirPath with origin mapping to the space at URL.
func ConfigureRepo ¶
ConfigureRepo applies fn to the config of the repo at repoPath
func MarshalIAMPolicy ¶
func MarshalIAMRule ¶
Types ¶
type BranchSpec ¶
type BranchSpec struct { Volume VolumeSpec `json:"volume"` Salt []byte `json:"salt"` Annotations []branches.Annotation `json:"annotations"` CreatedAt tai64.TAI64 `json:"created_at"` }
type CellSpec ¶
type CellSpec struct { Local *LocalCellSpec `json:"local,omitempty"` HTTP *HTTPCellSpec `json:"http,omitempty"` Encrypted *EncryptedCellSpec `json:"encrypted,omitempty"` Signed *SignedCellSpec `json:"signed,omitempty"` }
func ParseCellSpec ¶
type Config ¶
type Config struct {
Spaces []SpaceLayerSpec `json:"spaces"`
}
func DefaultConfig ¶
func DefaultConfig() Config
type CryptoSpaceSpec ¶ added in v0.0.3
type EncryptedCellSpec ¶
type FileOperation ¶
type GRPCSpaceSpec ¶ added in v0.0.3
type HTTPCellSpec ¶
type LocalCellSpec ¶
type LocalCellSpec = CellID
type LocalStoreSpec ¶
type LocalStoreSpec = StoreID
type MultiSpaceSpec ¶
type MultiSpaceSpec []SpaceLayerSpec
type PeerCellSpec ¶
type PeerCellSpec struct { ID p2p.PeerID `json:"id"` Name string `json:"name"` }
type PrefixSpaceSpec ¶ added in v0.0.3
type PrivateKey ¶
type PrivateKey = inet256.PrivateKey
type QUICSpaceSpec ¶ added in v0.0.3
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) Add ¶
Add adds paths from the working directory to the staging area. Directories are traversed, and only paths are added. Adding a directory will update any existing paths and add new ones, it will not remove paths from version control
func (*Repo) CreateBranch ¶
func (r *Repo) CreateBranch(ctx context.Context, name string, params branches.Metadata) (*Branch, error)
CreateBranch creates a branch using the default spec.
func (*Repo) CreateBranchWithSpec ¶
func (r *Repo) CreateBranchWithSpec(name string, spec BranchSpec) (*Branch, error)
CreateBranchWithSpec creates a branch using spec
func (*Repo) DeleteBranch ¶
DeleteBranch deletes a branch
func (*Repo) ForEachBranch ¶
ForEachBranch calls fn once for each branch, or until an error is returned from fn
func (*Repo) ForEachStaging ¶
func (*Repo) ForEachUntracked ¶
ForEachUntracked lists all the files which are not in either:
- the staging area
- the active branch head
func (*Repo) GetActiveBranch ¶
GetActiveBranch returns the name of the active branch, and the branch
func (*Repo) GetBranchHead ¶
func (*Repo) GetIAMPolicy ¶
func (*Repo) GetImportStores ¶ added in v0.0.3
func (r *Repo) GetImportStores(ctx context.Context, branchName string) (*branches.StoreTriple, error)
GetImportStores returns a store triple for importing the branch.
func (*Repo) GetNativeURL ¶ added in v0.0.3
func (*Repo) GetPrivateKey ¶
func (r *Repo) GetPrivateKey() p2p.PrivateKey
func (*Repo) MakeVolume ¶
func (r *Repo) MakeVolume(spec VolumeSpec) (*Volume, error)
func (*Repo) Put ¶
Put replaces a path (file or directory) with whatever is in the working directory Adding a file updates the file. Adding a directory will delete paths not in the working directory, and add paths in the working directory.
func (*Repo) SetActiveBranch ¶
SetActiveBranch sets the active branch to name
func (*Repo) SetBranchHead ¶
SetBranchHead
func (*Repo) UnionStore ¶
func (*Repo) UpdateIAMPolicy ¶
func (*Repo) WorkingDir ¶
type SignedCellSpec ¶
type SpaceLayerSpec ¶
type SpaceSpec ¶
type SpaceSpec struct { Peer *inet256.ID `json:"peer,omitempty"` QUIC *QUICSpaceSpec `json:"quic,omitempty"` GRPC *GRPCSpaceSpec `json:"grpc,omitempty"` Crypto *CryptoSpaceSpec `json:"crypto,omitempty"` Prefix *PrefixSpaceSpec `json:"prefix,omitempty"` }
type StoreSpec ¶
type StoreSpec struct {
Local *LocalStoreSpec `json:"local,omitempty"`
}
type VolumeSpec ¶
type VolumeSpec struct { Cell CellSpec `json:"cell"` VCStore StoreSpec `json:"vc_store"` FSStore StoreSpec `json:"fs_store"` RawStore StoreSpec `json:"raw_store"` }
func ParseVolumeSpec ¶
func ParseVolumeSpec(data []byte) (*VolumeSpec, error)