api

package
v2.124.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 12 Imported by: 2 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

This section is empty.

Variables

View Source
var (
	UserAgentString = GetUserAgentString("")
)

Functions

func ApiGet

func ApiGet(sling *sling.Sling, inputStruct interface{}, path string) (interface{}, error)

Generic OctopusDeploy API Get Function.

func GetAIAgent added in v2.124.0

func GetAIAgent(e Environment) string

GetAIAgent returns a User-Agent comment naming the AI agent driving this process, or an empty string when none is detected. Only a normalised name is reported: the raw AI_AGENT value is free-form and user-settable, so it is used for matching and never included in the output. Detection is based on self-reported environment variables, so it is suitable for analytics but must not be relied on for security decisions.

Examples:

(ai-agent=ClaudeCode)   AI_AGENT=claude-code_2-1-322_agent, or CLAUDECODE=1
(ai-agent=Cursor)       CURSOR_AGENT=1
(ai-agent=Other)        AI_AGENT set to a value that isn't recognised

func GetAutomationEnvironment added in v2.17.0

func GetAutomationEnvironment(e Environment) string

func GetUserAgentString

func GetUserAgentString(requestingTool string) string

Types

type Environment added in v2.17.0

type Environment interface {
	Getenv(key string) string
}

type MockEnvironment added in v2.17.0

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

func NewMockEnvironment added in v2.17.0

func NewMockEnvironment() *MockEnvironment

func (MockEnvironment) Getenv added in v2.17.0

func (e MockEnvironment) Getenv(key string) string

func (MockEnvironment) Setenv added in v2.17.0

func (e MockEnvironment) Setenv(key string, value string)

type OsEnvironment added in v2.17.0

type OsEnvironment struct{}

func (OsEnvironment) Getenv added in v2.17.0

func (e OsEnvironment) Getenv(key string) string

Jump to

Keyboard shortcuts

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