autoflow

package
v1.131.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package autoflow connects to the AutoFlow service of GitLab Relay with a token-exchange token minted by GitLab for the gitlab-autoflow audience.

Index

Constants

View Source
const TokenBindingSize = 64

TokenBindingSize is the exact length StartWorkflow requires of a token binding.

Variables

This section is empty.

Functions

func ChannelValue

func ChannelValue(name string) *autoflowv1.Value

ChannelValue returns the value that hands a workflow the channel name.

func MarshalProtoValue

func MarshalProtoValue(v *autoflowv1.Value) ([]byte, error)

MarshalProtoValue encodes v in its protobuf JSON form.

func MarshalValue

func MarshalValue(v *autoflowv1.Value) ([]byte, error)

MarshalValue encodes v as plain JSON: None and a missing value become null, an integer or a float a number, a list an array and a dict with string keys an object in the dict's order. A float is written like Python's repr writes it, with a fraction or an exponent, so it does not read back as an integer. A value without a JSON equivalent, such as a channel, a tuple or bytes, is encoded in its protobuf JSON form.

func ParseValue

func ParseValue(data []byte) (*autoflowv1.Value, error)

ParseValue converts a JSON document into an AutoFlow value. null becomes None, a number without a fraction or exponent an integer and any other number a float, an array a list and an object a dict with string keys in the order the document lists them.

Types

type Conn

type Conn struct {
	autoflowrpcv1.AutoFlowServiceClient
	// contains filtered or unexported fields
}

Conn is a connection to the AutoFlow service.

func Dial

func Dial(ctx context.Context, gl *gitlab.Client, address string, tlsConfig *tls.Config) (*Conn, error)

Dial exchanges the caller's GitLab credential for a token Relay accepts on its public listener and connects to the AutoFlow service at address over TLS, or in cleartext if tlsConfig is nil. Each call exchanges a fresh token when the current one has less than refreshMargin left, so the connection outlives a single token. The caller must close the returned connection.

func (*Conn) Close

func (c *Conn) Close() error

Close closes the connection.

func (*Conn) Organization

func (c *Conn) Organization() (uuid.UUID, error)

Organization returns the organization the connection's token is issued for, its gitlab.origin_id claim.

Jump to

Keyboard shortcuts

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