Help us shape the future of Go! Take the 2026 Go Developer Survey

meshstack

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

AccessLevels is the order the login page offers them in.

View Source
var EndpointSetting = setting.Setting[xurl.URL]{
	Env: "MESHSTACK_ENDPOINT",
	Short: func(envKey string) string {
		return fmt.Sprintf("The meshStack API to act against, such as https://api.example.meshcloud.io. Also read from %s.", envKey)
	},
	Long: func(envKey string) string {
		return fmt.Sprintf("The meshStack API to act against, such as `https://api.example.meshcloud.io`, "+
			"also read from `%s` and inferred from current profile if possible.", envKey)
	},
	Parse: setting.ParseTextUnmarshaler[xurl.URL],
}
View Source
var SkipVersionCheckSetting = setting.Setting[bool]{
	Env: "MESHSTACK_SKIP_VERSION_CHECK",
	Short: func(envKey string) string {
		return fmt.Sprintf("Skip the meshStack version and release checks, so a run sends only the requests it needs. Also read from %s.", envKey)
	},
	Parse: setting.ParseBool,

	Default: setting.StaticDefault("0"),
}

SkipVersionCheckSetting skips both the minimum backend version check and the check for a newer release of the front end itself.

View Source
var WorkspaceSetting = setting.Setting[Workspace]{
	Env: "MESHSTACK_WORKSPACE",
	Short: func(envKey string) string {
		return fmt.Sprintf("The workspace to act in, identified as in meshPanel, such as my-workspace-ab12c. Also read from %s.", envKey)
	},
	Parse: setting.ParseText[Workspace],
}

Functions

func SetWorkspacesInContext

func SetWorkspacesInContext(ctx context.Context, workspacesFunc WorkspacesFunc) context.Context

Types

type AccessLevel added in v0.3.0

type AccessLevel string

AccessLevel limits a browser login to a subset of the user's rights.

const (
	AccessFull  AccessLevel = "full"
	AccessWrite AccessLevel = "write"
	AccessRead  AccessLevel = "read"
)

func AccessLevelOf added in v0.3.0

func AccessLevelOf(scopes scope.Scopes) (AccessLevel, bool)

func ParseAccessLevel added in v0.3.0

func ParseAccessLevel(value string) (AccessLevel, bool)

func (AccessLevel) Detail added in v0.3.0

func (l AccessLevel) Detail() string

func (AccessLevel) Label added in v0.3.0

func (l AccessLevel) Label() string

func (AccessLevel) Scope added in v0.3.0

func (l AccessLevel) Scope() scope.Scope

Scope must match the client scopes that CliClientBootstrapService in ../meshfed-release creates.

type Existence added in v0.3.0

type Existence int
const (
	ExistenceUnknown Existence = iota
	Exists
	DoesNotExist
)

type MeshWorkspace

type MeshWorkspace struct {
	client.MeshWorkspace

	IsAdmin bool
}

MeshWorkspace is a workspace to select from, where a Workspace only names one.

func (MeshWorkspace) Label added in v0.3.0

func (w MeshWorkspace) Label() string

func (MeshWorkspace) Matches

func (w MeshWorkspace) Matches(other MeshWorkspace) bool

func (MeshWorkspace) Name

func (w MeshWorkspace) Name() Workspace

func (MeshWorkspace) String

func (w MeshWorkspace) String() string

type NoRoleInWorkspaceError added in v0.3.0

type NoRoleInWorkspaceError struct {
	Workspace Workspace
	Existence Existence
}

NoRoleInWorkspaceError is what a login gets that asks for a token for a workspace in which it has no role. The issuer then mints a token for no workspace.

func (NoRoleInWorkspaceError) Error added in v0.3.0

func (e NoRoleInWorkspaceError) Error() string

type NoWorkspaceToWorkInError added in v0.3.0

type NoWorkspaceToWorkInError struct {
	// MayNotList is set where meshStack refused the list, rather than answering an empty one.
	MayNotList bool
}

NoWorkspaceToWorkInError is what a login gets whose workspace list holds nothing to choose from.

func (NoWorkspaceToWorkInError) Error added in v0.3.0

func (e NoWorkspaceToWorkInError) Error() string

type Workspace

type Workspace string

Workspace identifies a workspace as meshPanel shows it.

const NoWorkspace Workspace = ""

NoWorkspace means that no workspace is known, or that the authentication is unscoped. It is the zero value, so `omitzero` leaves it out of a stored profile.

func (Workspace) String

func (w Workspace) String() string

type WorkspaceNotNamedError added in v0.6.0

type WorkspaceNotNamedError struct {
	Resolution error
}

func (WorkspaceNotNamedError) Error added in v0.6.0

func (e WorkspaceNotNamedError) Error() string

func (WorkspaceNotNamedError) Unwrap added in v0.6.0

func (e WorkspaceNotNamedError) Unwrap() error

type Workspaces

type Workspaces struct {
	Items []client.MeshWorkspace
	// AdminWorkspace is the workspace of meshPanel's admin area. The listed workspaces do not
	// mark it, so it comes from client.MeshInfo.AdminWorkspaceIdentifier.
	AdminWorkspace          Workspace
	ProfileDefaultWorkspace Workspace
}

func WorkspacesFromContext

func WorkspacesFromContext(ctx context.Context) (Workspaces, error)

func (Workspaces) All

func (ws Workspaces) All() iter.Seq2[int, MeshWorkspace]

func (Workspaces) ProfileDefault

func (ws Workspaces) ProfileDefault(ctx context.Context) (r *MeshWorkspace)

type WorkspacesFunc

type WorkspacesFunc func() (Workspaces, error)

Jump to

Keyboard shortcuts

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