zcontext

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MPL-2.0 Imports: 1 Imported by: 1 module, 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 zcontext is used to store the context information for the application.

Index

Constants

View Source
const (
	KeyContext = "context"

	KeyProject     = KeyContext + ".project"
	KeyProjectID   = KeyProject + ".id"
	KeyProjectName = KeyProject + ".name"

	KeyEnvironment     = KeyContext + ".environment"
	KeyEnvironmentID   = KeyEnvironment + ".id"
	KeyEnvironmentName = KeyEnvironment + ".name"

	KeyService     = KeyContext + ".service"
	KeyServiceID   = KeyService + ".id"
	KeyServiceName = KeyService + ".name"
)

Keys for context

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicInfo

type BasicInfo interface {
	GetID() string
	GetName() string
	Empty() bool
}

BasicInfo represents the basic information of a resource.

func NewBasicInfo

func NewBasicInfo(id, name string) BasicInfo

type Context

type Context interface {
	GetProject() BasicInfo
	SetProject(project BasicInfo)
	ClearProject()

	GetEnvironment() BasicInfo
	SetEnvironment(environment BasicInfo)
	ClearEnvironment()

	GetService() BasicInfo
	SetService(service BasicInfo)
	ClearService()

	ClearAll()
}

Context represents the current context of the CLI, including the current project, environment, service, etc.

func NewViperContext

func NewViperContext(viper *viper.Viper) Context

NewViperContext creates a new Context based on viper

Jump to

Keyboard shortcuts

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