protocol

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 26 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// PipelineContextData types
	PipelineContextString     = 0
	PipelineContextArray      = 1
	PipelineContextDictionary = 2
	PipelineContextBool       = 3
	PipelineContextNumber     = 4
)
View Source
const (
	// TemplateToken types
	TokenTypeLiteral    = 0 // Literal string
	TokenTypeSequence   = 1 // Array/sequence
	TokenTypeMapping    = 2 // Object/mapping
	TokenTypeExpression = 3 // Expression to be evaluated
	TokenTypeInsert     = 4 // Insert directive
	TokenTypeBool       = 5 // Bool type
	TokenTypeNumber     = 6 // Number type
	TokenTypeNull       = 7 // Null

)

Variables

View Source
var (
	TimestampInputFormat  = "2006-01-02T15:04:05.9999999Z07:00" // allow to omit fractional seconds
	TimestampOutputFormat = "2006-01-02T15:04:05.0000000Z07:00" // dotnet "O"
)

Functions

This section is empty.

Types

type ActionDownloadAuthentication added in v0.6.0

type ActionDownloadAuthentication struct {
	ExpiresAt string `json:",omitempty"`
	Token     string
}

type ActionDownloadInfo added in v0.6.0

type ActionDownloadInfo struct {
	Authentication        *ActionDownloadAuthentication `json:",omitempty"`
	NameWithOwner         string
	ResolvedNameWithOwner string
	ResolvedSha           string
	TarballURL            string
	Ref                   string
	ZipballURL            string
}

type ActionDownloadInfoCollection added in v0.6.0

type ActionDownloadInfoCollection struct {
	Actions map[string]ActionDownloadInfo
}

type ActionReference added in v0.6.0

type ActionReference struct {
	NameWithOwner string
	Ref           string
	Path          string
}

type ActionReferenceList added in v0.6.0

type ActionReferenceList struct {
	Actions []ActionReference
}

type ActionStep

type ActionStep struct {
	ID               string
	Type             string
	Reference        ActionStepDefinitionReference
	DisplayNameToken *TemplateToken
	ContextName      string
	Environment      *TemplateToken
	Inputs           *TemplateToken
	Condition        string
	ContinueOnError  *TemplateToken
	TimeoutInMinutes *TemplateToken
}

type ActionStepDefinitionReference

type ActionStepDefinitionReference struct {
	Type           string
	Image          string
	Name           string
	Ref            string
	RepositoryType string
	Path           string
}

type ActionsEnvironmentReference

type ActionsEnvironmentReference struct {
	Name *string `json:",omitempty"`
	URL  *string `json:",omitempty"`
}

type AgentJobRequestMessage

type AgentJobRequestMessage struct {
	MessageType          string
	Plan                 *TaskOrchestrationPlanReference
	Timeline             *TimeLineReference
	JobID                string
	JobDisplayName       string
	JobName              string
	JobContainer         *TemplateToken
	JobServiceContainers *TemplateToken
	JobOutputs           *TemplateToken
	RequestID            int64
	LockedUntil          string
	Resources            *JobResources
	ContextData          map[string]PipelineContextData
	Workspace            *WorkspaceOptions
	MaskHints            []MaskHint `json:"mask"`
	EnvironmentVariables []TemplateToken
	Defaults             []TemplateToken
	ActionsEnvironment   *ActionsEnvironmentReference
	Variables            map[string]VariableValue
	Steps                []ActionStep
	FileTable            []string
	BillingOwnerID       string `json:"billingOwnerId,omitempty"`
}

func (*AgentJobRequestMessage) GetConnection added in v0.3.0

func (jobreq *AgentJobRequestMessage) GetConnection(name string) (*VssConnection, map[string]string, error)

type AgentLabel

type AgentLabel struct {
	ID   int
	Name string
	Type string
}

type AgentMessageConnection

type AgentMessageConnection struct {
	VssConnection    *VssConnection
	TaskAgentSession *TaskAgentSession
	Block            cipher.Block
	Status           string
	ServerV2URL      string
}

func (*AgentMessageConnection) Delete

func (session *AgentMessageConnection) Delete(ctx context.Context) error

func (*AgentMessageConnection) DeleteMessage

func (session *AgentMessageConnection) DeleteMessage(ctx context.Context, message *TaskAgentMessage) error

func (*AgentMessageConnection) GetNextMessage

func (session *AgentMessageConnection) GetNextMessage(ctx context.Context) (*TaskAgentMessage, error)

func (*AgentMessageConnection) GetSingleMessage added in v0.11.0

func (session *AgentMessageConnection) GetSingleMessage(ctx context.Context) (*TaskAgentMessage, error)

type BrokerMigration added in v0.8.0

type BrokerMigration struct {
	BrokerBaseURL string `json:"brokerBaseUrl"`
}

type ConnectionData

type ConnectionData struct {
	LocationServiceData LocationServiceData
}

func (*ConnectionData) GetServiceDefinition

func (connectionData *ConnectionData) GetServiceDefinition(id string) *ServiceDefinition

type DictionaryContextDataPair

type DictionaryContextDataPair struct {
	Key   string              `json:"k"`
	Value PipelineContextData `json:"v"`
}

type GitHubAuthResult

type GitHubAuthResult struct {
	TenantURL   string `json:"url"`
	TokenSchema string `json:"token_schema"`
	Token       string `json:"token"`
	UseV2FLow   bool   `json:"use_v2_flow"`
}

type GitHubRunnerRegisterToken

type GitHubRunnerRegisterToken struct {
	Token     string `json:"token"`
	ExpiresAt string `json:"expires_at"`
}

type Issue

type Issue struct {
	Type                  string // notice, error or warning
	Category              string
	Message               string
	IsInfrastructureIssue *bool
	Data                  map[string]string
}

type JobAuthorization

type JobAuthorization struct {
	Parameters map[string]string
	Scheme     string
}

type JobEndpoint

type JobEndpoint struct {
	Data          map[string]string
	Name          string
	URL           string
	Authorization JobAuthorization
	IsShared      bool
	IsReady       bool
}

type JobEvent

type JobEvent struct {
	Name               string
	JobID              string
	RequestID          int64
	Result             string
	Outputs            *map[string]VariableValue    `json:",omitempty"`
	ActionsEnvironment *ActionsEnvironmentReference `json:",omitempty"`
}

type JobResources

type JobResources struct {
	Endpoints []JobEndpoint
}

type ListRunnersResponse added in v0.11.0

type ListRunnersResponse struct {
	TotalCount int      `json:"total_count"`
	Runners    []Runner `json:"runners"`
}

type LocationServiceData

type LocationServiceData struct {
	ServiceDefinitions []ServiceDefinition
}

type MapEntry

type MapEntry struct {
	Key   *TemplateToken
	Value *TemplateToken
}

type MaskHint

type MaskHint struct {
	Type  string
	Value string
}

type PipelineContextData

type PipelineContextData struct {
	Type            *int32                       `json:"t,omitempty"`
	BoolValue       *bool                        `json:"b,omitempty"`
	NumberValue     *float64                     `json:"n,omitempty"`
	StringValue     *string                      `json:"s,omitempty"`
	ArrayValue      *[]PipelineContextData       `json:"a,omitempty"`
	DictionaryValue *[]DictionaryContextDataPair `json:"d,omitempty"`
}

func ToPipelineContextData added in v0.6.0

func ToPipelineContextData(data interface{}) PipelineContextData

func ToPipelineContextDataWithError added in v0.6.0

func ToPipelineContextDataWithError(data interface{}) (PipelineContextData, error)

func (PipelineContextData) ToRawObject

func (ctx PipelineContextData) ToRawObject() interface{}

func (*PipelineContextData) UnmarshalJSON

func (ctx *PipelineContextData) UnmarshalJSON(data []byte) error

type PropertiesCollection added in v0.12.0

type PropertiesCollection map[string]PropertyValue

func (*PropertiesCollection) Lookup added in v0.12.0

func (c *PropertiesCollection) Lookup(name, ty string) (interface{}, bool)

func (*PropertiesCollection) LookupBool added in v0.12.0

func (c *PropertiesCollection) LookupBool(name string) (value, ok bool)

func (*PropertiesCollection) LookupString added in v0.12.0

func (c *PropertiesCollection) LookupString(name string) (string, bool)

type PropertyValue added in v0.12.0

type PropertyValue struct {
	Type  string      `json:"$type"`
	Value interface{} `json:"$value"`
}

func (*PropertyValue) UnmarshalJSON added in v0.12.0

func (v *PropertyValue) UnmarshalJSON(data []byte) error

type RenewAgent

type RenewAgent struct {
	RequestID int64
}

type Runner added in v0.11.0

type Runner struct {
	Name          string `json:"name"`
	Id            int64  `json:"id"`
	Authorization struct {
		AuthorizationURL string `json:"authorization_url"`
		ServerURL        string `json:"server_url"`
		ClientId         string `json:"client_id"`
	} `json:"authorization"`
}

type RunnerAddRemove

type RunnerAddRemove struct {
	URL         string `json:"url"`
	RunnerEvent string `json:"runner_event"`
}

type RunnerGroup added in v0.11.0

type RunnerGroup struct {
	Id        int32  `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	IsDefault bool   `json:"default,omitempty"`
	IsHosted  bool   `json:"is_hosted,omitempty"`
}

type RunnerGroupList added in v0.11.0

type RunnerGroupList struct {
	RunnerGroups []RunnerGroup `json:"runner_groups"`
	Count        int           `json:"total_count"`
}

type ServiceDefinition

type ServiceDefinition struct {
	ServiceType       string
	Identifier        string
	DisplayName       string
	RelativeToSetting string
	RelativePath      string
	Description       string
	ServiceOwner      string
	ResourceVersion   int
	MinVersion        string
	MaxVersion        string
}

type TaskAgent

type TaskAgent struct {
	Authorization     TaskAgentAuthorization
	Labels            []AgentLabel
	MaxParallelism    int
	ID                int64
	Name              string
	Version           string
	OSDescription     string
	Enabled           *bool `json:",omitempty"`
	ProvisioningState string
	AccessPoint       string `json:",omitempty"`
	CreatedOn         string
	Ephemeral         bool `json:",omitempty"`
	DisableUpdate     bool `json:",omitempty"`
	Properties        PropertiesCollection
}

func (*TaskAgent) Authorize

func (taskAgent *TaskAgent) Authorize(c *http.Client, key interface{}) (*VssOAuthTokenResponse, error)

type TaskAgentAuthorization

type TaskAgentAuthorization struct {
	AuthorizationURL string `json:",omitempty"`
	ClientID         string `json:",omitempty"`
	PublicKey        TaskAgentPublicKey
}

type TaskAgentMessage

type TaskAgentMessage struct {
	MessageID   int64
	MessageType string
	IV          string
	Body        string
}

func (*TaskAgentMessage) Decrypt added in v0.3.0

func (message *TaskAgentMessage) Decrypt(session *AgentMessageConnection) ([]byte, error)

func (*TaskAgentMessage) FetchBrokerIfNeeded added in v0.8.0

func (message *TaskAgentMessage) FetchBrokerIfNeeded(xctx context.Context, session *AgentMessageConnection) error

type TaskAgentPool

type TaskAgentPool struct {
	TaskAgentPoolReference
}

type TaskAgentPoolReference

type TaskAgentPoolReference struct {
	ID    int64
	Scope string
	// PoolType   int
	Name       string
	IsHosted   bool
	IsInternal bool
	Size       int64
}

type TaskAgentPools

type TaskAgentPools struct {
	Count int64
	Value []TaskAgentPool
}

type TaskAgentPublicKey

type TaskAgentPublicKey struct {
	Exponent string
	Modulus  string
}

type TaskAgentSession

type TaskAgentSession struct {
	SessionID              string `json:",omitempty"`
	EncryptionKey          TaskAgentSessionKey
	OwnerName              string
	Agent                  TaskAgent
	UseFipsEncryption      bool
	BrokerMigrationMessage *BrokerMigration `json:",omitempty"`
}

func (*TaskAgentSession) GetSessionKey

func (session *TaskAgentSession) GetSessionKey(key *rsa.PrivateKey) (cipher.Block, error)

type TaskAgentSessionKey

type TaskAgentSessionKey struct {
	Encrypted bool
	Value     string
}

type TaskAgents

type TaskAgents struct {
	Count int64
	Value []TaskAgent
}

type TaskLog

type TaskLog struct {
	TaskLogReference
	IndexLocation *string `json:",omitempty"`
	Path          *string `json:",omitempty"`
	LineCount     *int64  `json:",omitempty"`
	CreatedOn     string
	LastChangedOn string
}

type TaskLogReference

type TaskLogReference struct {
	ID       int
	Location *string
}

type TaskOrchestrationPlanReference

type TaskOrchestrationPlanReference struct {
	ScopeIdentifier string
	PlanID          string
	PlanType        string
	Version         int32
}

type TemplateToken

type TemplateToken struct {
	FileID    *int32
	Line      *int32
	Column    *int32
	Type      int32
	Bool      *bool
	Num       *float64
	Lit       *string
	Expr      *string
	Directive *string
	Seq       *[]*TemplateToken
	Map       *[]MapEntry
}

func (*TemplateToken) FromRawObject

func (token *TemplateToken) FromRawObject(value interface{})

func (*TemplateToken) ToJSONRawObject added in v0.3.0

func (token *TemplateToken) ToJSONRawObject() interface{}

func (*TemplateToken) ToRawObject

func (token *TemplateToken) ToRawObject() interface{}

func (*TemplateToken) ToYamlNode

func (token *TemplateToken) ToYamlNode() *yaml.Node

func (*TemplateToken) UnmarshalJSON

func (token *TemplateToken) UnmarshalJSON(data []byte) error

type TemplateTokenConverter added in v0.6.0

type TemplateTokenConverter struct {
	AllowExpressions    bool // If false expressions cause an error or are encoded as a string
	IgnoreDefaultValues bool // Some act structs use have non present fields, which are encoded into a yaml node
	StringKeys          bool
}

func (*TemplateTokenConverter) FromRawObject added in v0.6.0

func (converter *TemplateTokenConverter) FromRawObject(value interface{}) (*TemplateToken, error)

func (*TemplateTokenConverter) FromYamlNode added in v0.6.0

func (converter *TemplateTokenConverter) FromYamlNode(node *yaml.Node) (ret *TemplateToken, err error)

func (*TemplateTokenConverter) ToRawObject added in v0.6.0

func (converter *TemplateTokenConverter) ToRawObject(token *TemplateToken) (interface{}, error)

func (*TemplateTokenConverter) ToYamlNode added in v0.6.0

func (converter *TemplateTokenConverter) ToYamlNode(token *TemplateToken) (ret *yaml.Node, err error)

type TimeLineReference

type TimeLineReference struct {
	ID       string
	ChangeID int
	Location *interface{}
}

type TimelineAttempt

type TimelineAttempt struct{}

type TimelineRecord

type TimelineRecord struct {
	ID               string
	TimelineID       string
	ParentID         string
	Type             string
	Name             string
	StartTime        string
	FinishTime       *string
	CurrentOperation *string
	PercentComplete  int32
	State            string
	Result           *string
	ResultCode       *string
	ChangeID         int32
	LastModified     string
	WorkerName       string
	Order            int32
	RefName          string
	Log              *TaskLogReference
	Details          *TimeLineReference
	ErrorCount       int
	WarningCount     int
	Issues           []Issue
	Location         string
	Attempt          int32
	Identifier       *string
	AgentPlatform    string
	PreviousAttempts []TimelineAttempt
	Variables        map[string]VariableValue
}

func CreateTimelineEntry

func CreateTimelineEntry(parent, refname, name string) TimelineRecord

func (*TimelineRecord) Complete

func (rec *TimelineRecord) Complete(res string)

func (*TimelineRecord) Start

func (rec *TimelineRecord) Start()

type TimelineRecordFeedLinesWrapper

type TimelineRecordFeedLinesWrapper struct {
	Count     int64
	Value     []string
	StepID    string
	StartLine *int64
}

type TimelineRecordWrapper

type TimelineRecordWrapper struct {
	Count int64
	Value []*TimelineRecord
}

type VariableValue

type VariableValue struct {
	Value    string
	IsSecret bool
}

type VssConnection

type VssConnection struct {
	Client    *http.Client
	TenantURL string

	Token      string
	AuthHeader string
	PoolID     int64
	TaskAgent  *TaskAgent
	Key        *rsa.PrivateKey
	Trace      bool
	// contains filtered or unexported fields
}

func (*VssConnection) BuildURL added in v0.3.0

func (vssConnection *VssConnection) BuildURL(relativePath string, ppath, query map[string]string) (string, error)

func (*VssConnection) CreateSession

func (vssConnection *VssConnection) CreateSession(ctx context.Context) (*AgentMessageConnection, error)

func (*VssConnection) CreateSessionExt added in v0.11.0

func (vssConnection *VssConnection) CreateSessionExt(ctx context.Context, serverV2URL string) (*AgentMessageConnection, error)

func (*VssConnection) DeleteAgent

func (vssConnection *VssConnection) DeleteAgent(taskAgent *TaskAgent) error

func (*VssConnection) FinishJob

func (vssConnection *VssConnection) FinishJob(e *JobEvent, plan *TaskOrchestrationPlanReference) error

func (*VssConnection) GetAgentPools

func (vssConnection *VssConnection) GetAgentPools() (*TaskAgentPools, error)

func (*VssConnection) GetConnectionData

func (vssConnection *VssConnection) GetConnectionData() *ConnectionData

func (*VssConnection) GetServiceURL added in v0.3.0

func (vssConnection *VssConnection) GetServiceURL(
	ctx context.Context, serviceID string, urlParameter, queryParameter map[string]string,
) (string, error)

func (*VssConnection) HTTPClient added in v0.11.0

func (vssConnection *VssConnection) HTTPClient() *http.Client

func (*VssConnection) LoadSession

func (vssConnection *VssConnection) LoadSession(ctx context.Context, session *TaskAgentSession) (*AgentMessageConnection, error)

func (*VssConnection) Request

func (vssConnection *VssConnection) Request(
	serviceID, protocol, method string, urlParameter, queryParameter map[string]string, requestBody, responseBody interface{},
) error

func (*VssConnection) RequestWithContext

func (vssConnection *VssConnection) RequestWithContext(
	ctx context.Context,
	serviceID, protocol, method string,
	urlParameter, queryParameter map[string]string,
	requestBody, responseBody interface{},
) error

func (*VssConnection) RequestWithContext2 added in v0.3.0

func (vssConnection *VssConnection) RequestWithContext2(
	ctx context.Context, method, requestURL, protocol string, requestBody, responseBody interface{},
) error

func (*VssConnection) SendLogLines added in v0.3.0

func (vssConnection *VssConnection) SendLogLines(
	plan *TaskOrchestrationPlanReference, timelineID string, lines *TimelineRecordFeedLinesWrapper,
) error

func (*VssConnection) UpdateTimeLine

func (vssConnection *VssConnection) UpdateTimeLine(timelineID string, jobreq *AgentJobRequestMessage, wrap *TimelineRecordWrapper) error

func (*VssConnection) UploadLogFile

func (vssConnection *VssConnection) UploadLogFile(timelineID string, jobreq *AgentJobRequestMessage, logContent string) (int, error)

type VssOAuthTokenResponse

type VssOAuthTokenResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	TokenType   string `json:"token_type"`
}

type WorkspaceOptions

type WorkspaceOptions struct {
	Clean *string `json:",omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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