common

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: BSD-3-Clause Imports: 3 Imported by: ? 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

Index

Constants

View Source
const (
	Auth      = "auth"
	Patrick   = "patrick"
	Monkey    = "monkey"
	TNS       = "tns"
	Hoarder   = "hoarder"
	Substrate = "substrate"
	Seer      = "seer"
	Gateway   = "gateway"
	Accounts  = "accounts"
)

Variables

View Source
var (
	Services          = []string{Auth, Patrick, Monkey, TNS, Hoarder, Substrate, Seer, Gateway}
	Clients           = []string{Auth, Patrick, Monkey, TNS, Hoarder, Substrate, Seer}
	HTTPServices      = []string{Patrick, Substrate, Seer, Auth, Gateway}
	P2PStreamServices = []string{Seer, Auth, Patrick, TNS, Monkey, Hoarder, Substrate}
)
View Source
var DefaultBranches = []string{"main", "master"}

TODO remove this and iterate, default branch should be gathered from a given repository

View Source
var ServicesRequiringRaft = []string{
	Patrick,
}

ServicesRequiringRaft are shapes that need config.SetRaftCluster before the service starts.

Functions

func RegisterService added in v1.2.0

func RegisterService(name string, caps ServiceCapabilities)

RegisterService makes name a known service so shapes can reference it and the node/Dream can provision its resources. It is the extension point for build-tag-gated services (e.g. ee) that register themselves from an init(). It is idempotent: a name already known is left untouched, so registration is safe to reach through more than one import path.

func RequiresRaftCluster added in v1.2.0

func RequiresRaftCluster(services []string) bool

RequiresRaftCluster reports whether services includes a shape listed in ServicesRequiringRaft.

func ValidateServices

func ValidateServices(services []string, ops ...ValidateOption) error

Types

type PathVariable

type PathVariable string
const (
	ProjectPathVariable     PathVariable = "projects"
	ApplicationPathVariable PathVariable = "applications"
	ProjectIndexVariable    PathVariable = "project"

	LinksPathVariable         PathVariable = "links"
	BranchPathVariable        PathVariable = "branches"
	CommitPathVariable        PathVariable = "commit"
	CurrentCommitPathVariable PathVariable = "current"
)

func (PathVariable) String

func (pv PathVariable) String() string

type ServiceCapabilities added in v1.2.0

type ServiceCapabilities struct {
	HTTP      bool
	P2PStream bool
	Client    bool
}

ServiceCapabilities declares which shared resources a registered service takes part in, so the node and Dream provision the right things for it:

  • HTTP: added to HTTPServices, so the shared HTTP server is created for shapes that include this service (see cli/node/start.go) and cfg.Http() is non-nil.
  • P2PStream: added to P2PStreamServices (p2p command/stream handlers).
  • Client: added to Clients (a typed p2p client other nodes can dial).

type TnsPath

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

func Current

func Current(projectId, branch string) *TnsPath

func NewTnsPath

func NewTnsPath(value []string) *TnsPath

func (*TnsPath) Slice

func (_path *TnsPath) Slice() []string

func (*TnsPath) String

func (_path *TnsPath) String() string

func (*TnsPath) Versioning

func (_path *TnsPath) Versioning() *VersioningPath

type ValidateOption

type ValidateOption func(string) error

func ValidateHttp

func ValidateHttp() ValidateOption

func ValidateP2P

func ValidateP2P() ValidateOption

type VersioningPath

type VersioningPath struct {
	*TnsPath
}

func (*VersioningPath) Commit

func (b *VersioningPath) Commit(commit string) *TnsPath
func (b *VersioningPath) Links() *TnsPath

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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