protocol

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TimestampInputFormat = "2006-01-02T15:04:05.9999999Z07:00" // allow to omit fractional seconds
View Source
var 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
}

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
}

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)

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"`
}

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 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 RenewAgent

type RenewAgent struct {
	RequestID int64
}

type RunnerAddRemove

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

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                int
	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"`
}

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(block cipher.Block) ([]byte, 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
}

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 string, refname string, 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
	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 map[string]string, query map[string]string) (string, error)

func (*VssConnection) CreateSession

func (vssConnection *VssConnection) CreateSession(ctx context.Context) (*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 map[string]string, queryParameter map[string]string) (string, error)

func (*VssConnection) HttpClient added in v0.6.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 string, protocol string, method string, urlParameter map[string]string, queryParameter map[string]string, requestBody interface{}, responseBody interface{}) error

func (*VssConnection) RequestWithContext

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

func (*VssConnection) RequestWithContext2 added in v0.3.0

func (vssConnection *VssConnection) RequestWithContext2(ctx context.Context, method string, url string, protocol string, requestBody interface{}, 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