api

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type AcquireTokenResult

type AcquireTokenResult struct {
	State string `json:"state"` // consumed, expired, authorized, pending
	Token string `json:"token,omitempty"`
}

type Client

type Client struct {
	http.RoundTripper
}

Client is an API Client for Mint

func NewClient

func NewClient(cfg Config) (Client, error)

func NewClientWithRoundTrip

func NewClientWithRoundTrip(rt func(*http.Request) (*http.Response, error)) Client

func (Client) AcquireToken

func (c Client) AcquireToken(tokenUrl string) (*AcquireTokenResult, error)

AcquireToken consumes the one-time-use code once authorized

func (Client) GetDebugConnectionInfo

func (c Client) GetDebugConnectionInfo(debugKey string) (DebugConnectionInfo, error)

func (Client) GetDispatch

func (c Client) GetDispatch(cfg GetDispatchConfig) (*GetDispatchResult, error)

func (Client) GetPackageVersions added in v1.9.0

func (c Client) GetPackageVersions() (*PackageVersionsResult, error)

func (Client) ImagePushStatus added in v1.12.0

func (c Client) ImagePushStatus(pushID string) (ImagePushStatusResult, error)

func (Client) InitiateDispatch

func (c Client) InitiateDispatch(cfg InitiateDispatchConfig) (*InitiateDispatchResult, error)

func (Client) InitiateRun

func (c Client) InitiateRun(cfg InitiateRunConfig) (*InitiateRunResult, error)

InitiateRun sends a request to Mint for starting a new run

func (Client) Lint

func (c Client) Lint(cfg LintConfig) (*LintResult, error)

func (Client) McpGetRunTestFailures added in v1.11.0

func (c Client) McpGetRunTestFailures(cfg McpGetRunTestFailuresRequest) (*McpTextResult, error)

func (Client) ObtainAuthCode

func (c Client) ObtainAuthCode(cfg ObtainAuthCodeConfig) (*ObtainAuthCodeResult, error)

ObtainAuthCode requests a new one-time-use code to login on a device

func (Client) ResolveBaseLayer

func (c Client) ResolveBaseLayer(cfg ResolveBaseLayerConfig) (ResolveBaseLayerResult, error)

func (Client) SetSecretsInVault

func (c Client) SetSecretsInVault(cfg SetSecretsInVaultConfig) (*SetSecretsInVaultResult, error)

func (Client) StartImagePush added in v1.12.0

func (c Client) StartImagePush(cfg StartImagePushConfig) (StartImagePushResult, error)

func (Client) Whoami

func (c Client) Whoami() (*WhoamiResult, error)

Whoami provides details about the authenticated token

type Config

type Config struct {
	Host               string
	AccessToken        string
	AccessTokenBackend accesstoken.Backend
}

func (Config) Validate

func (c Config) Validate() error

type DebugConnectionInfo

type DebugConnectionInfo struct {
	Debuggable     bool
	Address        string
	PublicHostKey  string `json:"public_host_key"`
	PrivateUserKey string `json:"private_user_key"`
}

type DebugConnectionInfoError

type DebugConnectionInfoError struct {
	Error string
}

type ErrorMessage

type ErrorMessage struct {
	Message    string                `json:"message"`
	StackTrace []messages.StackEntry `json:"stack_trace,omitempty"`
	Frame      string                `json:"frame"`
	Advice     string                `json:"advice"`
}

type GetDispatchConfig

type GetDispatchConfig struct {
	DispatchId string
}

type GetDispatchResult

type GetDispatchResult struct {
	Status string
	Error  string
	Runs   []GetDispatchRun
}

type GetDispatchRun

type GetDispatchRun = struct {
	RunId  string `json:"run_id"`
	RunUrl string `json:"run_url"`
}

type GitMetadata added in v1.13.0

type GitMetadata struct {
	Branch    string `json:"branch"`
	Sha       string `json:"sha"`
	OriginUrl string `json:"origin_url"`
}

type ImagePushStatusResult added in v1.12.0

type ImagePushStatusResult struct {
	Status string `json:"status"`
}

type InitializationParameter

type InitializationParameter struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type InitiateDispatchConfig

type InitiateDispatchConfig struct {
	DispatchKey string            `json:"key"`
	Params      map[string]string `json:"params"`
	Title       string            `json:"title,omitempty"`
	Ref         string            `json:"ref,omitempty"`
}

func (InitiateDispatchConfig) Validate

func (c InitiateDispatchConfig) Validate() error

type InitiateDispatchResult

type InitiateDispatchResult struct {
	DispatchId string
}

type InitiateRunConfig

type InitiateRunConfig struct {
	InitializationParameters []InitializationParameter `json:"initialization_parameters"`
	TaskDefinitions          []RwxDirectoryEntry       `json:"task_definitions"`
	RwxDirectory             []RwxDirectoryEntry       `json:"mint_directory"`
	TargetedTaskKeys         []string                  `json:"targeted_task_keys,omitempty"`
	Title                    string                    `json:"title,omitempty"`
	UseCache                 bool                      `json:"use_cache"`
	Git                      GitMetadata               `json:"git"`
	Patch                    PatchMetadata             `json:"patch"`
}

func (InitiateRunConfig) Validate

func (c InitiateRunConfig) Validate() error

type InitiateRunResult

type InitiateRunResult struct {
	RunId            string
	RunURL           string
	TargetedTaskKeys []string
	DefinitionPath   string
	Message          string
}

type LintConfig

type LintConfig struct {
	TaskDefinitions []TaskDefinition `json:"task_definitions"`
	TargetPaths     []string         `json:"target_paths"`
}

func (LintConfig) Validate

func (c LintConfig) Validate() error

type LintProblem

type LintProblem struct {
	Severity   string                `json:"severity"`
	Message    string                `json:"message"`
	FileName   string                `json:"file_name"`
	Line       NullInt               `json:"line"`
	Column     NullInt               `json:"column"`
	Advice     string                `json:"advice"`
	StackTrace []messages.StackEntry `json:"stack_trace,omitempty"`
	Frame      string                `json:"frame"`
}

func (LintProblem) FileLocation

func (lf LintProblem) FileLocation() string

type LintResult

type LintResult struct {
	Problems []LintProblem `json:"problems"`
}

type McpGetRunTestFailuresRequest added in v1.11.0

type McpGetRunTestFailuresRequest struct {
	RunUrls []string `json:"run_urls"`
}

type McpTextResult added in v1.11.0

type McpTextResult struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type NullInt

type NullInt struct {
	Value  int
	IsNull bool
}

func NewNullInt

func NewNullInt(value int) NullInt

func (NullInt) MarshalJSON

func (ni NullInt) MarshalJSON() ([]byte, error)

func (*NullInt) UnmarshalJSON

func (ni *NullInt) UnmarshalJSON(data []byte) error

type ObtainAuthCodeCode

type ObtainAuthCodeCode struct {
	DeviceName string `json:"device_name"`
}

type ObtainAuthCodeConfig

type ObtainAuthCodeConfig struct {
	Code ObtainAuthCodeCode `json:"code"`
}

func (ObtainAuthCodeConfig) Validate

func (c ObtainAuthCodeConfig) Validate() error

type ObtainAuthCodeResult

type ObtainAuthCodeResult struct {
	AuthorizationUrl string `json:"authorization_url"`
	TokenUrl         string `json:"token_url"`
}

type PackageVersionsResult added in v1.9.0

type PackageVersionsResult struct {
	Renames     map[string]string            `json:"renames"`
	LatestMajor map[string]string            `json:"latest_major"`
	LatestMinor map[string]map[string]string `json:"latest_minor"`
}

type PatchMetadata added in v1.13.0

type PatchMetadata struct {
	Sent           bool     `json:"sent"`
	LFSFiles       []string `json:"lfs_files"`
	LFSCount       int      `json:"lfs_count"`
	UntrackedFiles []string `json:"untracked_files"`
	UntrackedCount int      `json:"untracked_count"`
}

type ResolveBaseLayerConfig

type ResolveBaseLayerConfig = resolveBaseLayerSpec

type ResolveBaseLayerResult

type ResolveBaseLayerResult = resolveBaseLayerSpec

type RwxDirectoryEntry

type RwxDirectoryEntry struct {
	OriginalPath string `json:"-"`
	Path         string `json:"path"`
	Type         string `json:"type"`
	Permissions  uint32 `json:"permissions"`
	FileContents string `json:"file_contents"`
}

func (RwxDirectoryEntry) IsDir

func (e RwxDirectoryEntry) IsDir() bool

func (RwxDirectoryEntry) IsFile

func (e RwxDirectoryEntry) IsFile() bool

type Secret

type Secret struct {
	Name   string `json:"name"`
	Secret string `json:"secret"`
}

type SetSecretsInVaultConfig

type SetSecretsInVaultConfig struct {
	Secrets   []Secret `json:"secrets"`
	VaultName string   `json:"vault_name"`
}

type SetSecretsInVaultResult

type SetSecretsInVaultResult struct {
	SetSecrets []string `json:"set_secrets"`
}

type StartImagePushConfig added in v1.12.0

type StartImagePushConfig struct {
	TaskID      string                          `json:"task_id"`
	Image       StartImagePushConfigImage       `json:"image"`
	Credentials StartImagePushConfigCredentials `json:"credentials"`
}

type StartImagePushConfigCredentials added in v1.12.0

type StartImagePushConfigCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type StartImagePushConfigImage added in v1.12.0

type StartImagePushConfigImage struct {
	Registry   string   `json:"registry"`
	Repository string   `json:"repository"`
	Tags       []string `json:"tags"`
}

type StartImagePushResult added in v1.12.0

type StartImagePushResult struct {
	PushID string `json:"push_id"`
	RunURL string `json:"run_url"`
}

type TaskDefinition

type TaskDefinition struct {
	Path         string `json:"path"`
	FileContents string `json:"file_contents"`
}

type WhoamiResult

type WhoamiResult struct {
	OrganizationSlug string  `json:"organization_slug"`
	TokenKind        string  `json:"token_kind"` // organization_access_token, personal_access_token
	UserEmail        *string `json:"user_email,omitempty"`
}

Jump to

Keyboard shortcuts

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