mlx

package module
v0.0.0-...-d779a9d Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 16 Imported by: 0

README

mlx-go-sdk

Go Version License Tests

Go SDK for Multilogin X with typed services for profiles, launcher control, cookies, resources, proxy generation, archive handling, retries, and verified high-level workflows.

Install

go get github.com/bath0ry/mlx-go-sdk@latest

Quick start

Set environment variables in the consumer project:

  • MLX_TOKEN
  • MLX_BASE_URL (optional)
  • MLX_LAUNCHER_URL (optional)
  • MLX_COOKIES_URL (optional)
  • MLX_PROXY_URL (optional)

Create a production-style client:

client, err := mlx.NewFromEnv(
    mlx.WithTimeout(30*time.Second),
    mlx.WithRetry(mlx.RetryOptions{
        MaxAttempts:     4,
        InitialInterval: 500 * time.Millisecond,
        MaxInterval:     2 * time.Second,
        Multiplier:      2,
    }),
    mlx.WithUserAgent("acme-mlx-cli/1.0"),
)

Reference CLI

This repository now includes a reference CLI scaffold at cmd/mlx.

Build or run it with:

go build ./cmd/mlx
go run ./cmd/mlx --help
Global install

Install the CLI globally so mlx is available on your PATH:

go install github.com/minskyagenda0708-cmd/mlx-go-sdk/cmd/mlx@latest

go install places the mlx binary in $(go env GOBIN), or $(go env GOPATH)/bin when GOBIN is unset. Ensure that directory is on your PATH.

Authentication is read only from the MLX_TOKEN environment variable — never from flags or config files.

export MLX_TOKEN=your-token
mlx --version
mlx profile --help

To stamp a version into the binary at install time, override CLIVersion with ldflags:

go install -ldflags "-X github.com/minskyagenda0708-cmd/mlx-go-sdk/internal/cli.CLIVersion=v0.1.0" ./cmd/mlx

Current command groups are:

  • config
  • folder
  • template
  • profile
  • launcher
  • export
  • import
  • extension
  • cookies
  • proxy

CLI configuration rules:

  • authentication is environment-only via MLX_TOKEN
  • endpoint overrides remain compatible with the SDK environment variables:
    • MLX_BASE_URL
    • MLX_LAUNCHER_URL
    • MLX_COOKIES_URL
    • MLX_PROXY_URL
  • additional CLI-oriented environment overrides are supported for convenience:
    • MLX_CONFIG_FILE
    • MLX_OUTPUT
    • MLX_TIMEOUT
    • MLX_USER_AGENT
  • effective settings follow: flags → environment → config file → built-in defaults
  • supported output formats are table, json, and yaml

The CLI is intentionally scoped to config/folder/template/profile/launcher/export/import/extension/cookies/proxy workflows only. It does not add interactive auth flows or mobile profile commands.

Consumer-oriented guides

  • docs/cli-reference.md — reference CLI command groups, examples, and SDK mapping
  • docs/cli-config.md — CLI config schema, precedence rules, and defaults
  • docs/verified-workflows.md — verified create/find/start/stop/import/export/extension flows
  • docs/batch-helpers.md — multi-profile workflow helpers with aggregated errors
  • docs/rod-example.md — Rod attachment flow using SDK automation helpers
  • docs/extensions.md — extension upload and attach workflows
  • docs/proxy-workflows.md — managed MLX proxy generation and patching
  • docs/retries.md — retry and error classification behavior
  • docs/consumer-guide.md — production usage patterns, examples, and cmd/ layout suggestions

Core areas

  • client.Profiles — create, search, patch, move, clone, meta reads
  • client.Launcher — start, stop, status, version, health
  • client.Transfers — import/export job control
  • client.Archives — export-to-folder file organization
  • client.Cookies — metadata, list, import/export, cookie seeding
  • client.Resources — templates, extensions, object storage flows
  • client.Proxies — MLX proxy generation and parsing
  • client.Workflows — higher-level verified flows

Test layout

The repository keeps the default test flow simple:

go test ./...

Practical test scope guidance:

  • root package tests cover the SDK's fast package-level validation, including unit-style and mocked API/workflow coverage
  • example/documentation tests live alongside the main package so examples stay close to exported APIs
  • live validation is opt-in and guarded by MLX_RUN_E2E=1 so ordinary test runs do not hit real Multilogin X services accidentally
  • the repository is moving toward a clearer split between fast default tests and explicitly-invoked live E2E coverage

When running live checks, keep launcher/service requirements explicit and prefer targeted commands instead of broad workspace-wide test sweeps.

Notes

  • Treat ProfileMeta.IsLocal as diagnostic only; prefer parameters.storage.is_local and verified workflow signals.
  • Prefer SOCKS5 for MLX managed proxies in real automation flows.
  • For extension attachment, object-centric verification is stronger than profile-centric usage reads in some live environments.

Documentation

Index

Examples

Constants

View Source
const (
	EnvBaseURL      = "MLX_BASE_URL"
	EnvLauncherURL  = "MLX_LAUNCHER_URL"
	EnvCookiesURL   = "MLX_COOKIES_URL"
	EnvProxyURL     = "MLX_PROXY_URL"
	EnvRunE2E       = "MLX_RUN_E2E"
	EnvE2EFolderID  = "MLX_E2E_FOLDER_ID"
	EnvE2EProfileID = "MLX_E2E_PROFILE_ID"
)
View Source
const (
	ResourceTypeProfileTemplates         = "7e46e7f9-15d4-41b6-83b9-a652336793ec"
	ResourceTypeProxyConfiguration       = "3c1a0080-5282-436b-885c-ab27d5004aa8"
	ResourceTypeExtensions               = "6811b909-2e4b-45db-ab62-f14f515523cf"
	ResourceTypeCookies                  = "58268a18-02b8-4d2d-ac59-9cc166ea4064"
	ResourceTypePasswords                = "bb80e9b9-b2bb-43b5-968b-c2ea9b509d7a"
	ResourceTypeAutomationScripts        = "8dfc6cec-4aad-41f0-ac87-ff44a4be0b3a"
	ResourceTypeLaunchParameterTemplates = "42d592bc-df3a-47b5-8d50-4b338df6ade2"
)
View Source
const (
	// EnvToken is the environment variable that stores the long-lived MultiloginX token.
	EnvToken = "MLX_TOKEN"
)

Variables

View Source
var (
	ErrMissingToken       = errors.New("mlx token is required")
	ErrNilContext         = errors.New("context must not be nil")
	ErrInvalidBaseURL     = errors.New("invalid base url")
	ErrInvalidLauncherURL = errors.New("invalid launcher url")
	ErrProfileNotFound    = errors.New("profile not found")
	ErrProfileAmbiguous   = errors.New("profile lookup matched multiple profiles")
)
View Source
var DefaultCheckTargets = []string{
	"https://www.google.com",
	"https://www.facebook.com",
	"https://medium.com",
}

DefaultCheckTargets are browser-common sites used to measure proxy health.

Functions

func ChromeWebStoreExtensionDownloadURL

func ChromeWebStoreExtensionDownloadURL(extensionID string) (string, error)

ChromeWebStoreExtensionDownloadURL converts a Chrome Web Store extension ID into the CRX download URL expected by the launcher extension creation endpoint.

func DefaultArchiveFolderName

func DefaultArchiveFolderName(profileName, profileID string, exportedAt time.Time) string

DefaultArchiveFolderName returns a safe directory name for a profile archive.

Example
package main

import (
	"fmt"
	"strings"
	"time"

	mlx "github.com/minskyagenda0708-cmd/mlx-go-sdk"
)

func main() {
	name := mlx.DefaultArchiveFolderName(`John: Doe/QA`, "profile-1", time.Date(2026, 4, 19, 12, 0, 0, 0, time.UTC))
	fmt.Println(strings.Contains(name, ":"), strings.Contains(name, "/"))
}
Output:
false false

func IsRateLimitedError

func IsRateLimitedError(err error) bool

IsRateLimitedError reports whether the error represents an MLX/API rate limit condition.

func IsRetryableError

func IsRetryableError(err error) bool

IsRetryableError reports whether the given error is safe to retry automatically.

func IsTemporaryError

func IsTemporaryError(err error) bool

IsTemporaryError reports whether the given error is likely transient.

func RetryAfter

func RetryAfter(err error) time.Duration

RetryAfter returns the recommended delay extracted from a typed SDK error when present.

Types

type AllProfileStatusesData

type AllProfileStatusesData struct {
	ActiveCounter LauncherActiveCounter           `json:"active_counter"`
	States        map[string]ProfileRuntimeStatus `json:"states"`
}

AllProfileStatusesData wraps all launcher states.

type AllProfileStatusesResponse

type AllProfileStatusesResponse struct {
	Status Status                 `json:"status"`
	Data   AllProfileStatusesData `json:"data"`
}

AllProfileStatusesResponse contains all profile runtime states.

func (*AllProfileStatusesResponse) GetStatus

func (r *AllProfileStatusesResponse) GetStatus() Status

type ArchiveManager

type ArchiveManager interface {
	OrganizeExport(string, string, string) (*OrganizedArchive, error)
	ExportProfileToFolder(context.Context, string, ExportProfileToFolderOptions) (*ManagedExportResult, error)
}

ArchiveManager provides filesystem-oriented helpers for export flows.

type ArchiveManagerOp

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

ArchiveManagerOp is the concrete archive manager implementation.

func (*ArchiveManagerOp) ExportProfileToFolder

func (m *ArchiveManagerOp) ExportProfileToFolder(ctx context.Context, profileID string, opts ExportProfileToFolderOptions) (*ManagedExportResult, error)

ExportProfileToFolder exports a profile, waits for completion, and then organizes the resulting zip on disk.

func (*ArchiveManagerOp) OrganizeExport

func (m *ArchiveManagerOp) OrganizeExport(exportPath, rootDir, folderName string) (*OrganizedArchive, error)

OrganizeExport moves an exported zip into a dedicated folder without renaming the zip file itself.

type ArgError

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

ArgError describes an invalid input argument.

func NewArgError

func NewArgError(arg, reason string) *ArgError

func (*ArgError) Error

func (e *ArgError) Error() string

type AssignTagsRequest

type AssignTagsRequest struct {
	TagIDs     []string `json:"tag_ids"`
	ProfileIDs []string `json:"profile_ids"`
}

AssignTagsRequest assigns tags to profiles.

type AutomationEndpointError

type AutomationEndpointError struct {
	RequestedAutomation AutomationType
	LauncherAutomation  AutomationType
	Port                string
	Message             string
	Err                 error
}

AutomationEndpointError describes an unusable launcher automation endpoint.

func (*AutomationEndpointError) Error

func (e *AutomationEndpointError) Error() string

func (*AutomationEndpointError) Unwrap

func (e *AutomationEndpointError) Unwrap() error

type AutomationType

type AutomationType string

AutomationType describes the launcher automation mode.

const (
	AutomationSelenium   AutomationType = "selenium"
	AutomationPlaywright AutomationType = "playwright"
	AutomationPuppeteer  AutomationType = "puppeteer"
	AutomationRod        AutomationType = "rod"
)

type BatchItemResult

type BatchItemResult[T any] struct {
	ProfileName string
	Result      *T
	Err         error
}

BatchItemResult stores the per-profile outcome of a batch workflow helper.

type BatchProfileOperationError

type BatchProfileOperationError struct {
	Operation string
	Failures  []ProfileBatchFailure
}

BatchProfileOperationError aggregates failures from a multi-profile helper.

func (*BatchProfileOperationError) Error

func (*BatchProfileOperationError) Unwrap

func (e *BatchProfileOperationError) Unwrap() []error

Unwrap exposes all underlying item errors for errors.Is/errors.As checks.

type BatchResult

type BatchResult[T any] struct {
	Summary BatchSummary
	Items   []BatchItemResult[T]
}

BatchResult stores ordered per-profile outcomes together with a summary.

func (*BatchResult[T]) Failures

func (r *BatchResult[T]) Failures() []ProfileBatchFailure

Failures returns the failed profile entries from the batch result.

type BatchSummary

type BatchSummary struct {
	Total     int
	Succeeded int
	Failed    int
}

BatchSummary reports how many profile items succeeded or failed.

type BrowserCookie

type BrowserCookie struct {
	Name           string `json:"name,omitempty"`
	Value          string `json:"value,omitempty"`
	Domain         string `json:"domain,omitempty"`
	Path           string `json:"path,omitempty"`
	Secure         bool   `json:"secure,omitempty"`
	HTTPOnly       bool   `json:"httpOnly,omitempty"`
	Session        bool   `json:"session,omitempty"`
	HostOnly       bool   `json:"hostOnly,omitempty"`
	StoreID        string `json:"storeId,omitempty"`
	SameSite       string `json:"sameSite,omitempty"`
	SameParty      bool   `json:"sameParty,omitempty"`
	SourcePort     int    `json:"sourcePort,omitempty"`
	SourceScheme   string `json:"sourceScheme,omitempty"`
	ExpirationDate int64  `json:"expirationDate,omitempty"`
	Size           int    `json:"size,omitempty"`
}

BrowserCookie describes an individual browser cookie.

type Client

type Client struct {
	Profiles  ProfilesService
	Launcher  LauncherService
	Proxies   ProxyService
	Folders   FoldersService
	Transfers TransfersService
	Archives  ArchiveManager
	Cookies   CookiesService
	Resources ResourcesService
	Workflows WorkflowService
	Tags      TagsService
	// contains filtered or unexported fields
}

Client is the main entry point for the MultiloginX SDK.

func New

func New(opts ...Option) (*Client, error)

New creates a new MultiloginX client.

func NewFromEnv

func NewFromEnv(opts ...Option) (*Client, error)

NewFromEnv creates a client using the `MLX_TOKEN` environment variable.

Example (ProductionClient)
package main

import (
	"fmt"
	"os"
	"time"

	mlx "github.com/minskyagenda0708-cmd/mlx-go-sdk"
)

func main() {
	_ = os.Setenv(mlx.EnvToken, "test-token")
	_ = os.Setenv(mlx.EnvBaseURL, "https://api.example.test")
	_ = os.Setenv(mlx.EnvLauncherURL, "https://launcher.example.test:45001")
	_ = os.Setenv(mlx.EnvCookiesURL, "https://cookies.example.test")
	_ = os.Setenv(mlx.EnvProxyURL, "https://proxy.example.test")
	defer os.Unsetenv(mlx.EnvToken)
	defer os.Unsetenv(mlx.EnvBaseURL)
	defer os.Unsetenv(mlx.EnvLauncherURL)
	defer os.Unsetenv(mlx.EnvCookiesURL)
	defer os.Unsetenv(mlx.EnvProxyURL)

	client, err := mlx.NewFromEnv(
		mlx.WithTimeout(30*time.Second),
		mlx.WithRetry(mlx.RetryOptions{
			MaxAttempts:     4,
			InitialInterval: 500 * time.Millisecond,
			MaxInterval:     2 * time.Second,
			Multiplier:      2,
			Jitter:          0,
		}),
		mlx.WithUserAgent("acme-mlx-cli/1.0"),
	)
	if err != nil {
		fmt.Println("error:", err)
		return
	}

	fmt.Println(client != nil)
}
Output:
true

func (*Client) PatchProfileForProxy

func (c *Client) PatchProfileForProxy(ctx context.Context, profileID string, proxy *Proxy) (*EmptyDataResponse, *Response, error)

PatchProfileForProxy installs the given proxy into a profile and automatically adjusts language, locale, timezone, screen, and browser UI language to match the proxy country. Screen resolution defaults to 1920×1080 (FHD).

Use PatchProfileForProxyWithOptions for finer control over screen bounds.

func (*Client) PatchProfileForProxyWithOptions

func (c *Client) PatchProfileForProxyWithOptions(ctx context.Context, profileID string, proxy *Proxy, opts PatchProfileForProxyOptions) (*EmptyDataResponse, *Response, error)

PatchProfileForProxyWithOptions is the configurable variant of PatchProfileForProxy. It accepts PatchProfileForProxyOptions to control the range of screen resolutions.

type CloneProfileRequest

type CloneProfileRequest struct {
	ProfileID string `json:"profile_id"`
	Times     int    `json:"times"`
}

CloneProfileRequest clones a profile.

type CommandParam

type CommandParam struct {
	Flag  string `json:"flag,omitempty"`
	Value string `json:"value,omitempty"`
}

CommandParam describes a single command-line parameter.

type CommandParams

type CommandParams struct {
	Params []CommandParam `json:"params,omitempty"`
}

CommandParams wraps browser command-line parameters.

type CookieBundle

type CookieBundle struct {
	ID        int             `json:"id"`
	CreatedAt string          `json:"created_at"`
	Data      []BrowserCookie `json:"data"`
}

CookieBundle groups a generated cookie set.

type CookieExportData

type CookieExportData struct {
	Cookies   string `json:"cookies"`
	ProfileID string `json:"profile_id"`
	Timestamp int64  `json:"timestamp"`
}

CookieExportData contains launcher cookie export output.

type CookieExportRequest

type CookieExportRequest struct {
	ProfileID string `json:"profile_id"`
	FolderID  string `json:"folder_id,omitempty"`
}

CookieExportRequest exports profile cookies from the launcher.

type CookieExportResponse

type CookieExportResponse struct {
	Status Status           `json:"status"`
	Data   CookieExportData `json:"data"`
}

CookieExportResponse contains exported cookie JSON.

func (*CookieExportResponse) GetStatus

func (r *CookieExportResponse) GetStatus() Status

type CookieImportRequest

type CookieImportRequest struct {
	ProfileID             string          `json:"profile_id"`
	FolderID              string          `json:"folder_id,omitempty"`
	ImportAdvancedCookies bool            `json:"import_advanced_cookies"`
	Cookies               []BrowserCookie `json:"-"`
	StrictMode            bool            `json:"-"`
}

CookieImportRequest imports either advanced pre-made cookies or explicit cookie JSON into a profile.

func (CookieImportRequest) MarshalJSON

func (r CookieImportRequest) MarshalJSON() ([]byte, error)

MarshalJSON converts cookie arrays into the quoted JSON string format expected by the launcher endpoint.

type CookieListData

type CookieListData struct {
	Cookies []CookieBundle `json:"cookies"`
}

CookieListData wraps cookie bundles.

type CookieListResponse

type CookieListResponse struct {
	Status Status         `json:"status"`
	Data   CookieListData `json:"data"`
}

CookieListResponse contains pre-made cookie bundles for a profile.

func (*CookieListResponse) GetStatus

func (r *CookieListResponse) GetStatus() Status

type CookieWebsite

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

CookieWebsite describes an available pre-made cookie target.

type CookieWebsitesResponse

type CookieWebsitesResponse struct {
	Status Status          `json:"status"`
	Data   []CookieWebsite `json:"data"`
}

CookieWebsitesResponse contains target website options.

func (*CookieWebsitesResponse) GetStatus

func (r *CookieWebsitesResponse) GetStatus() Status

type CookiesMetadataData

type CookiesMetadataData struct {
	ProfileID string `json:"profile_id"`
}

CookiesMetadataData contains metadata creation output.

type CookiesMetadataResponse

type CookiesMetadataResponse struct {
	Status Status              `json:"status"`
	Data   CookiesMetadataData `json:"data"`
}

CookiesMetadataResponse returns the profile id affected by metadata creation.

func (*CookiesMetadataResponse) GetStatus

func (r *CookiesMetadataResponse) GetStatus() Status

type CookiesService

CookiesService manages pre-made cookies metadata and launcher cookie import/export flows.

type CookiesServiceOp

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

CookiesServiceOp is the concrete cookie service.

func (*CookiesServiceOp) CreateMetadata

func (*CookiesServiceOp) Export

func (*CookiesServiceOp) Import

func (*CookiesServiceOp) List

func (s *CookiesServiceOp) List(ctx context.Context, profileID string) (*CookieListResponse, *Response, error)

func (*CookiesServiceOp) ListWebsites

func (*CookiesServiceOp) SeedProfileCookies

SeedProfileCookies creates or updates pre-made cookies metadata, fetches generated cookies, and imports them into the profile.

func (*CookiesServiceOp) UpdateMetadata

type CreateAndUploadObjectData

type CreateAndUploadObjectData struct {
	MetaID string `json:"meta_id"`
}

CreateAndUploadObjectData contains the created resource id.

type CreateAndUploadObjectRequest

type CreateAndUploadObjectRequest struct {
	ObjectName      string `json:"object_name"`
	ObjectExtension string `json:"object_extension"`
	ObjectTypeID    string `json:"object_type_id"`
	ObjectBody      string `json:"object_body"`
	ObjectMeta      string `json:"object_meta,omitempty"`
	Encrypt         *bool  `json:"encrypt,omitempty"`
}

CreateAndUploadObjectRequest creates a new launcher-backed object from body content.

type CreateAndUploadObjectResponse

type CreateAndUploadObjectResponse struct {
	Status Status                    `json:"status"`
	Data   CreateAndUploadObjectData `json:"data"`
}

CreateAndUploadObjectResponse returns the created resource meta id.

func (*CreateAndUploadObjectResponse) GetStatus

func (r *CreateAndUploadObjectResponse) GetStatus() Status

type CreateChromeWebStoreExtensionRequest

type CreateChromeWebStoreExtensionRequest struct {
	ExtensionID string
	BrowserType string
	StorageType string
}

CreateChromeWebStoreExtensionRequest creates an extension from a Chrome Web Store ID.

type CreateCookiesMetadataRequest

type CreateCookiesMetadataRequest struct {
	ProfileID     string `json:"profile_id"`
	TargetWebsite string `json:"target_website"`
	StrictMode    bool   `json:"-"`
}

CreateCookiesMetadataRequest binds a profile to a pre-made cookie target website.

type CreateExtensionFromURLRequest

type CreateExtensionFromURLRequest struct {
	URL         string `json:"url"`
	BrowserType string `json:"browser_type"`
	StorageType string `json:"storage_type"`
}

CreateExtensionFromURLRequest materializes an extension object from a downloadable URL.

StorageType defaults to "cloud" because cloud-backed extension references are the safest choice for both cloud and local profiles.

type CreateFolderRequest

type CreateFolderRequest struct {
	Name    string `json:"name"`
	Comment string `json:"comment,omitempty"`
}

CreateFolderRequest creates a folder.

type CreateFolderResponse

type CreateFolderResponse struct {
	Status Status            `json:"status"`
	Data   CreatedFolderData `json:"data"`
}

CreateFolderResponse contains the created folder ID.

func (*CreateFolderResponse) GetStatus

func (r *CreateFolderResponse) GetStatus() Status

type CreateProfileRequest

type CreateProfileRequest struct {
	Name             string             `json:"name"`
	BrowserType      string             `json:"browser_type"`
	FolderID         string             `json:"folder_id"`
	OSType           string             `json:"os_type"`
	CoreVersion      int                `json:"core_version,omitempty"`
	CoreMinorVersion int                `json:"core_minor_version,omitempty"`
	AutoUpdateCore   *bool              `json:"auto_update_core,omitempty"`
	Times            int                `json:"times,omitempty"`
	Notes            string             `json:"notes,omitempty"`
	Parameters       *ProfileParameters `json:"parameters,omitempty"`
	Tags             []string           `json:"tags,omitempty"`
}

CreateProfileRequest creates one or more profiles.

type CreateProfileResponse

type CreateProfileResponse struct {
	Status Status            `json:"status"`
	Data   CreatedProfileIDs `json:"data"`
}

CreateProfileResponse contains created profile IDs.

func (*CreateProfileResponse) GetStatus

func (r *CreateProfileResponse) GetStatus() Status

type CreateProfileTemplateRequest

type CreateProfileTemplateRequest struct {
	Name      string
	Extension string
	Body      string
	Meta      string
	Encrypt   *bool
}

CreateProfileTemplateRequest creates a profile template resource.

type CreateProfilesAndVerifyOptions

type CreateProfilesAndVerifyOptions struct {
	PollOptions PollOptions
}

CreateProfilesAndVerifyOptions controls post-create verification polling.

type CreateTagItem

type CreateTagItem struct {
	Name  string `json:"name"`
	Color string `json:"color"`
}

CreateTagItem is a single tag to create.

type CreateTagsRequest

type CreateTagsRequest struct {
	Tags []CreateTagItem `json:"tags"`
}

CreateTagsRequest creates tags.

type CreatedFolderData

type CreatedFolderData struct {
	ID string `json:"id"`
}

CreatedFolderData wraps the created folder ID.

type CreatedProfileIDs

type CreatedProfileIDs struct {
	IDs []string `json:"ids"`
}

CreatedProfileIDs wraps returned profile IDs.

type CreatedProfilesWorkflowResult

type CreatedProfilesWorkflowResult struct {
	CreateResponse *CreateProfileResponse
	Profiles       []ProfileMeta
}

CreatedProfilesWorkflowResult contains created IDs and verified profile metas.

type DeleteFoldersRequest

type DeleteFoldersRequest struct {
	IDs []string `json:"ids"`
}

DeleteFoldersRequest removes folders.

type DeleteProfilesRequest

type DeleteProfilesRequest struct {
	IDs         []string `json:"ids"`
	Permanently bool     `json:"permanently"`
}

DeleteProfilesRequest removes profiles.

type DownloadResourceResponse

type DownloadResourceResponse struct {
	Status Status `json:"status"`
	Path   string `json:"-"`
}

DownloadResourceResponse contains the downloaded path materialized by the launcher.

func (*DownloadResourceResponse) GetStatus

func (r *DownloadResourceResponse) GetStatus() Status

type EmptyDataResponse

type EmptyDataResponse struct {
	Status Status `json:"status"`
	Data   any    `json:"data"`
}

EmptyDataResponse is used by endpoints returning null data.

func (*EmptyDataResponse) GetStatus

func (r *EmptyDataResponse) GetStatus() Status

type EnableExtensionForProfileByNameOptions

type EnableExtensionForProfileByNameOptions struct {
	FindOptions             *FindProfileOptions
	PollOptions             PollOptions
	RequireProfileUsageRead bool
}

EnableExtensionForProfileByNameOptions controls lookup and verification for extension attachment.

type EnabledExtensionWorkflowResult

type EnabledExtensionWorkflowResult struct {
	Profile         *Profile
	EnableResponse  *StringDataResponse
	ObjectUsages    *ObjectProfileUsagesResponse
	ProfileUsages   *ProfileObjectUsagesResponse
	ProfileUsageErr error
}

EnabledExtensionWorkflowResult contains the verified extension attachment state.

type EnsureHealthyProfileProxyOptions

type EnsureHealthyProfileProxyOptions struct {
	EnsureHealthyProxyOptions
	PreferSOCKS5 bool
	SaveTraffic  bool
}

EnsureHealthyProfileProxyOptions configures the service-level continuity check.

type EnsureHealthyProxyOptions

type EnsureHealthyProxyOptions struct {
	ThresholdMs        int          // preferred max latency; default 2000
	HardCapMs          int          // escalation cap; default 3000
	CandidatesPerRound int          // proxies generated per geo round; default 5
	Checker            ProxyChecker // default NewHTTPProxyChecker(HTTPProxyCheckerConfig{})
}

EnsureHealthyProxyOptions tunes proxy-continuity behavior.

type Envelope

type Envelope[T any] struct {
	Status Status `json:"status"`
	Data   T      `json:"data"`
}

Envelope is the common response wrapper used by MultiloginX endpoints.

type ErrorClass

type ErrorClass string

ErrorClass describes a typed SDK error category.

const (
	ErrorClassUnknown        ErrorClass = "unknown"
	ErrorClassCanceled       ErrorClass = "canceled"
	ErrorClassTimeout        ErrorClass = "timeout"
	ErrorClassNetwork        ErrorClass = "network"
	ErrorClassRateLimited    ErrorClass = "rate_limited"
	ErrorClassUnauthorized   ErrorClass = "unauthorized"
	ErrorClassForbidden      ErrorClass = "forbidden"
	ErrorClassNotFound       ErrorClass = "not_found"
	ErrorClassConflict       ErrorClass = "conflict"
	ErrorClassInvalidRequest ErrorClass = "invalid_request"
	ErrorClassServer         ErrorClass = "server"
)

func ClassifyError

func ClassifyError(err error) ErrorClass

ClassifyError returns a typed classification for SDK errors.

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response
	Status   Status `json:"status"`
	Body     []byte `json:"-"`
}

ErrorResponse represents a MultiloginX API error.

func (*ErrorResponse) Class

func (e *ErrorResponse) Class() ErrorClass

Class returns the typed error category for the API response.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

func (*ErrorResponse) IsRateLimited

func (e *ErrorResponse) IsRateLimited() bool

IsRateLimited reports whether the API error is a rate limit response.

func (*ErrorResponse) RetryAfter

func (e *ErrorResponse) RetryAfter() time.Duration

RetryAfter returns the parsed Retry-After header when present.

func (*ErrorResponse) Retryable

func (e *ErrorResponse) Retryable() bool

Retryable reports whether retry/backoff helpers should retry the API error.

func (*ErrorResponse) StatusCode

func (e *ErrorResponse) StatusCode() int

StatusCode returns the best available HTTP/status code for the response.

func (*ErrorResponse) Temporary

func (e *ErrorResponse) Temporary() bool

Temporary reports whether the API error is likely transient.

type ExportJobState

type ExportJobState struct {
	ExportID   string `json:"export_id"`
	ExportPath string `json:"export_path"`
	ProfileID  string `json:"profile_id"`
	Status     string `json:"status"`
	Message    string `json:"message"`
	Timestamp  int64  `json:"timestamp"`
}

ExportJobState describes an export job.

func (ExportJobState) ArchivePath

func (j ExportJobState) ArchivePath() string

ArchivePath returns the best importable archive path for an export job.

Live Multilogin X responses are inconsistent: - export start responses often return a `.zip` path - export done responses may return the same path without the `.zip` suffix

Import expects the concrete archive file path, so when the launcher returns an extensionless export path this method normalizes it to the expected `.zip` path.

type ExportProfileByNameToFolderOptions

type ExportProfileByNameToFolderOptions struct {
	FindOptions        *FindProfileOptions
	ExportOptions      ExportProfileToFolderOptions
	StopBeforeExport   bool
	IgnoreStopNotReady bool
}

ExportProfileByNameToFolderOptions controls the lookup and export workflow behavior.

type ExportProfileResponse

type ExportProfileResponse struct {
	Status Status         `json:"status"`
	Data   ExportJobState `json:"data"`
}

ExportProfileResponse contains export job details.

func (*ExportProfileResponse) GetStatus

func (r *ExportProfileResponse) GetStatus() Status

type ExportProfileToFolderOptions

type ExportProfileToFolderOptions struct {
	RootDir      string
	FolderName   string
	ProfileName  string
	PollInterval time.Duration
	WaitTimeout  time.Duration
}

ExportProfileToFolderOptions controls how an exported archive is organized on disk.

type ExportStatusResponse

type ExportStatusResponse struct {
	Status Status         `json:"status"`
	Data   ExportJobState `json:"data"`
}

ExportStatusResponse contains a single export job status.

func (*ExportStatusResponse) GetStatus

func (r *ExportStatusResponse) GetStatus() Status

type ExportStatusesData

type ExportStatusesData struct {
	Statuses []ExportJobState `json:"statuses"`
}

ExportStatusesData wraps export jobs.

type ExportStatusesResponse

type ExportStatusesResponse struct {
	Status Status             `json:"status"`
	Data   ExportStatusesData `json:"data"`
}

ExportStatusesResponse contains all export jobs.

func (*ExportStatusesResponse) GetStatus

func (r *ExportStatusesResponse) GetStatus() Status

type ExportedProfileWorkflowResult

type ExportedProfileWorkflowResult struct {
	Profile *Profile
	Export  *ManagedExportResult
}

ExportedProfileWorkflowResult contains the resolved profile and managed export result.

type FindProfileByNameVerifiedOptions

type FindProfileByNameVerifiedOptions struct {
	FindOptions *FindProfileOptions
}

FindProfileByNameVerifiedOptions controls exact-name lookup verification.

type FindProfileOptions

type FindProfileOptions struct {
	IsRemoved   bool
	StorageType string
	FolderID    string
	BrowserType string
	OSType      string
	Limit       int
	Tags        []string
}

FindProfileOptions narrows convenience profile lookups.

type Fingerprint

type Fingerprint struct {
	Navigator    *NavigatorFingerprint    `json:"navigator,omitempty"`
	Localization *LocalizationFingerprint `json:"localization,omitempty"`
	Timezone     *TimezoneFingerprint     `json:"timezone,omitempty"`
	Graphic      *GraphicFingerprint      `json:"graphic,omitempty"`
	WebRTC       *WebRTCFingerprint       `json:"webrtc,omitempty"`
	MediaDevices *MediaDevicesFingerprint `json:"media_devices,omitempty"`
	Screen       *ScreenFingerprint       `json:"screen,omitempty"`
	Geolocation  *GeolocationFingerprint  `json:"geolocation,omitempty"`
	Ports        []int                    `json:"ports,omitempty"`
	Fonts        []string                 `json:"fonts,omitempty"`
	CMDParams    *CommandParams           `json:"cmd_params,omitempty"`
}

Fingerprint contains typed browser fingerprint settings.

type Folder

type Folder struct {
	FolderID      string `json:"folder_id"`
	Name          string `json:"name"`
	Comment       string `json:"comment"`
	ProfilesCount int    `json:"profiles_count"`
	CreatedAt     string `json:"created_at"`
}

Folder describes a workspace folder.

type FoldersServiceOp

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

FoldersServiceOp is the concrete folder service.

func (*FoldersServiceOp) Create

func (*FoldersServiceOp) Delete

func (*FoldersServiceOp) List

func (*FoldersServiceOp) Update

type GenerateProfileProxyByNameOptions

type GenerateProfileProxyByNameOptions struct {
	FindOptions     *FindProfileOptions
	GenerateOptions GenerateProfileProxyRequest
	PatchProfile    bool
}

GenerateProfileProxyByNameOptions controls profile lookup, proxy generation, and profile patching.

type GenerateProfileProxyRequest

type GenerateProfileProxyRequest struct {
	GenerateProxyRequest
	PreferSOCKS5 bool
	SaveTraffic  bool
}

GenerateProfileProxyRequest generates and adapts an MLX proxy for profile APIs.

type GenerateProfileProxyResult

type GenerateProfileProxyResult struct {
	Connection   *GeneratedProxyConnection
	ProfileProxy *Proxy
	Usage        *ProxyUsageResponse
}

GenerateProfileProxyResult returns both the parsed connection and profile payload.

type GenerateProxyRequest

type GenerateProxyRequest struct {
	Country     string           `json:"country,omitempty"`
	SessionType ProxySessionType `json:"sessionType,omitempty"`
	Protocol    ProxyProtocol    `json:"protocol,omitempty"`
	Region      string           `json:"region,omitempty"`
	City        string           `json:"city,omitempty"`
	IPTTL       int              `json:"IPTTL,omitempty"`
	Count       int              `json:"count,omitempty"`
	StrictMode  bool             `json:"-"`
}

GenerateProxyRequest requests one or more MLX-managed proxy endpoints.

type GenerateProxyResponse

type GenerateProxyResponse struct {
	Status int                         `json:"status"`
	Data   []string                    `json:"data"`
	Parsed []*GeneratedProxyConnection `json:"-"`
}

GenerateProxyResponse contains generated connection strings and parsed variants.

func (*GenerateProxyResponse) UnmarshalJSON

func (r *GenerateProxyResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts both the documented single-string payload and the live array payload.

type GeneratedProfileProxyWorkflowResult

type GeneratedProfileProxyWorkflowResult struct {
	Profile       *Profile
	Connection    *GeneratedProxyConnection
	ProfileProxy  *Proxy
	Usage         *ProxyUsageResponse
	PatchResponse *EmptyDataResponse
}

GeneratedProfileProxyWorkflowResult contains the resolved profile and generated proxy artifacts.

type GeneratedProxyConnection

type GeneratedProxyConnection struct {
	Raw             string
	Protocol        ProxyProtocol
	Host            string
	Port            int
	Username        string
	Password        string
	Country         string
	Region          string
	City            string
	SessionID       string
	BillingID       string
	Filter          string
	RetentionKey    string
	RetentionSecret string
}

GeneratedProxyConnection is the parsed form of the returned MLX connection string.

func ParseGeneratedProxyConnection

func ParseGeneratedProxyConnection(raw string, protocol ProxyProtocol) (*GeneratedProxyConnection, error)

ParseGeneratedProxyConnection parses one MLX proxy connection string.

type GeolocationFingerprint

type GeolocationFingerprint struct {
	Accuracy  float64 `json:"accuracy,omitempty"`
	Altitude  float64 `json:"altitude,omitempty"`
	Latitude  float64 `json:"latitude,omitempty"`
	Longitude float64 `json:"longitude,omitempty"`
}

GeolocationFingerprint contains geolocation values.

type GraphicFingerprint

type GraphicFingerprint struct {
	Renderer string `json:"renderer,omitempty"`
	Vendor   string `json:"vendor,omitempty"`
	VendorID string `json:"vendor_id,omitempty"`
	DeviceID string `json:"device_id,omitempty"`
}

GraphicFingerprint contains GPU information.

type HTTPProxyChecker

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

HTTPProxyChecker measures proxy liveness/latency via stdlib net/http + httptrace.

func NewHTTPProxyChecker

func NewHTTPProxyChecker(cfg HTTPProxyCheckerConfig) *HTTPProxyChecker

NewHTTPProxyChecker builds a checker, applying defaults for empty fields.

func (*HTTPProxyChecker) Check

Check dials each target through the proxy, records TTFB, and returns the best.

type HTTPProxyCheckerConfig

type HTTPProxyCheckerConfig struct {
	Targets          []string      // defaults to DefaultCheckTargets
	PerTargetTimeout time.Duration // defaults to 10s
	UserAgent        string        // defaults to a Chrome-like UA
}

HTTPProxyCheckerConfig configures HTTPProxyChecker.

type ImportJobState

type ImportJobState struct {
	ExportID      string `json:"export_id"`
	ImportID      string `json:"import_id"`
	ImportPath    string `json:"import_path"`
	ExtractedPath string `json:"extracted_path"`
	NewProfileID  string `json:"new_profile_id"`
	Status        string `json:"status"`
	Message       string `json:"message"`
	Timestamp     int64  `json:"timestamp"`
}

ImportJobState describes an import job.

type ImportProfileRequest

type ImportProfileRequest struct {
	ImportPath string `json:"import_path"`
	IsLocal    bool   `json:"is_local"`
}

ImportProfileRequest imports a profile archive.

type ImportProfileResponse

type ImportProfileResponse struct {
	Status Status         `json:"status"`
	Data   ImportJobState `json:"data"`
}

ImportProfileResponse contains import job details.

func (*ImportProfileResponse) GetStatus

func (r *ImportProfileResponse) GetStatus() Status

type ImportProfileWorkflowOptions

type ImportProfileWorkflowOptions struct {
	PollOptions PollOptions
}

ImportProfileWorkflowOptions controls import verification.

type ImportStatusResponse

type ImportStatusResponse struct {
	Status Status         `json:"status"`
	Data   ImportJobState `json:"data"`
}

ImportStatusResponse contains a single import status.

func (*ImportStatusResponse) GetStatus

func (r *ImportStatusResponse) GetStatus() Status

type ImportStatusesData

type ImportStatusesData struct {
	Statuses []ImportJobState `json:"statuses"`
}

ImportStatusesData wraps all import jobs.

type ImportStatusesResponse

type ImportStatusesResponse struct {
	Status Status             `json:"status"`
	Data   ImportStatusesData `json:"data"`
}

ImportStatusesResponse contains all import jobs.

func (*ImportStatusesResponse) GetStatus

func (r *ImportStatusesResponse) GetStatus() Status

type ImportedProfileWorkflowResult

type ImportedProfileWorkflowResult struct {
	ImportResponse *ImportProfileResponse
	ImportStatus   *ImportStatusResponse
	ProfileMeta    *ProfileMeta
}

ImportedProfileWorkflowResult contains verified import artifacts.

type LauncherActiveCounter

type LauncherActiveCounter struct {
	Cloud int `json:"cloud"`
	Local int `json:"local"`
	Quick int `json:"quick"`
}

LauncherActiveCounter reports running profile counts by storage type.

type LauncherHealthData

type LauncherHealthData struct {
	Alive   bool   `json:"alive"`
	Env     string `json:"env,omitempty"`
	Version string `json:"version,omitempty"`
}

LauncherHealthData contains the launcher readiness state.

type LauncherHealthResponse

type LauncherHealthResponse struct {
	Status Status             `json:"status"`
	Data   LauncherHealthData `json:"data"`
}

LauncherHealthResponse reports whether the local launcher is reachable.

Multilogin X does not currently expose a dedicated health endpoint in the checked-in Postman collection, so this helper probes `/api/v1/version` as the launcher liveness/readiness check.

func (*LauncherHealthResponse) GetStatus

func (r *LauncherHealthResponse) GetStatus() Status

type LauncherServiceOp

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

LauncherServiceOp is the concrete launcher service.

func (*LauncherServiceOp) Health

func (*LauncherServiceOp) QuickStatuses

func (*LauncherServiceOp) SaveQuick

func (*LauncherServiceOp) Start

func (s *LauncherServiceOp) Start(ctx context.Context, folderID, profileID string, opts StartProfileOptions) (*StartProfileResponse, *Response, error)

func (*LauncherServiceOp) StartQuick

func (*LauncherServiceOp) Status

func (*LauncherServiceOp) Statuses

func (*LauncherServiceOp) Stop

func (s *LauncherServiceOp) Stop(ctx context.Context, profileID string) (*EmptyDataResponse, *Response, error)

func (*LauncherServiceOp) StopAll

func (*LauncherServiceOp) ValidateProxy

func (*LauncherServiceOp) Version

func (*LauncherServiceOp) WaitForRunning

func (s *LauncherServiceOp) WaitForRunning(ctx context.Context, profileID string, opts PollOptions) (*ProfileRuntimeStatusResponse, *Response, error)

type LauncherVersionData

type LauncherVersionData struct {
	Env     string `json:"env"`
	Version string `json:"version"`
}

LauncherVersionData contains version info.

type LauncherVersionResponse

type LauncherVersionResponse struct {
	Status Status              `json:"status"`
	Data   LauncherVersionData `json:"data"`
}

LauncherVersionResponse returns launcher version info.

func (*LauncherVersionResponse) GetStatus

func (r *LauncherVersionResponse) GetStatus() Status

type ListFoldersData

type ListFoldersData struct {
	Folders []Folder `json:"folders"`
}

ListFoldersData wraps the list of folders.

type ListFoldersResponse

type ListFoldersResponse struct {
	Status Status          `json:"status"`
	Data   ListFoldersData `json:"data"`
}

ListFoldersResponse contains folder listings.

func (*ListFoldersResponse) GetStatus

func (r *ListFoldersResponse) GetStatus() Status

type ListOptions

type ListOptions struct {
	Limit  int `json:"limit,omitempty"`
	Offset int `json:"offset,omitempty"`
}

ListOptions models offset-based listing used by profile search.

type ListResourceMetasOptions

type ListResourceMetasOptions struct {
	Limit           int
	Offset          int
	ObjectName      string
	ObjectTypeID    string
	StorageType     string
	Creator         string
	Trashbin        *bool
	CreateStartDate string
	CreateEndDate   string
	UpdateStartDate string
	UpdateEndDate   string
}

ListResourceMetasOptions controls resource meta listing.

type LocalToCloudObjectRequest

type LocalToCloudObjectRequest struct {
	ObjectPath string `json:"object_path"`
	ObjectID   string `json:"object_id,omitempty"`
}

LocalToCloudObjectRequest promotes a local object into cloud storage.

type LocaleProfile

type LocaleProfile struct {
	Localization *LocalizationFingerprint
	Timezone     *TimezoneFingerprint
}

LocaleProfile bundles localization and timezone fingerprint for a country.

func LocaleForCountry

func LocaleForCountry(countryCode string) *LocaleProfile

LocaleForCountry returns a preset LocaleProfile for the given ISO 3166-1 alpha-2 country code. If the country is unknown, it falls back to en-US / UTC.

type LocalizationFingerprint

type LocalizationFingerprint struct {
	Languages       string `json:"languages,omitempty"`
	Locale          string `json:"locale,omitempty"`
	AcceptLanguages string `json:"accept_languages,omitempty"`
}

LocalizationFingerprint contains language and locale settings.

type ManagedExportResult

type ManagedExportResult struct {
	ExportJob *ExportStatusResponse
	Archive   *OrganizedArchive
}

ManagedExportResult combines export job details with filesystem placement.

type MediaDevicesFingerprint

type MediaDevicesFingerprint struct {
	AudioInputs  int `json:"audio_inputs,omitempty"`
	AudioOutputs int `json:"audio_outputs,omitempty"`
	VideoInputs  int `json:"video_inputs,omitempty"`
}

MediaDevicesFingerprint contains media device counts.

type MoveProfilesRequest

type MoveProfilesRequest struct {
	DestinationFolderID string   `json:"dest_folder_id"`
	IDs                 []string `json:"ids,omitempty"`
}

MoveProfilesRequest moves profiles into another folder.

type NavigatorFingerprint struct {
	HardwareConcurrency int    `json:"hardware_concurrency,omitempty"`
	Platform            string `json:"platform,omitempty"`
	UserAgent           string `json:"user_agent,omitempty"`
	OSCPU               string `json:"os_cpu,omitempty"`
	MaxTouchPoints      int    `json:"max_touch_points,omitempty"`
}

NavigatorFingerprint contains navigator-related values.

type ObjectProfileUsage

type ObjectProfileUsage struct {
	ID       string `json:"id"`
	ObjectID string `json:"object_id"`
}

ObjectProfileUsage identifies one object-to-profile usage record.

type ObjectProfileUsagesResponse

type ObjectProfileUsagesResponse struct {
	Status Status               `json:"status"`
	Data   []ObjectProfileUsage `json:"data"`
}

ObjectProfileUsagesResponse lists profile usages for one object.

func (*ObjectProfileUsagesResponse) GetStatus

func (r *ObjectProfileUsagesResponse) GetStatus() Status

type Option

type Option func(*Client) error

Option configures a Client.

func WithBaseURL

func WithBaseURL(raw string) Option

WithBaseURL overrides the REST API base URL.

func WithCookiesURL

func WithCookiesURL(raw string) Option

WithCookiesURL overrides the pre-made cookies API base URL.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient overrides the underlying HTTP client.

func WithLauncherURL

func WithLauncherURL(raw string) Option

WithLauncherURL overrides the local launcher base URL.

func WithProxyURL

func WithProxyURL(raw string) Option

WithProxyURL overrides the MLX profile proxy API base URL.

func WithRetry

func WithRetry(opts RetryOptions) Option

WithRetry configures automatic retries for transient transport and MLX API failures.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the HTTP client timeout.

func WithToken

func WithToken(token string) Option

WithToken sets the bearer token explicitly.

func WithUserAgent

func WithUserAgent(userAgent string) Option

WithUserAgent sets the user agent header.

type OrganizedArchive

type OrganizedArchive struct {
	SourcePath  string
	ArchiveDir  string
	ArchivePath string
	ZipFileName string
	FolderName  string
}

OrganizedArchive describes where an exported archive ended up on disk.

type PatchProfileForProxyOptions

type PatchProfileForProxyOptions struct {
	// MinScreenWidth is the minimum screen width for the generated fingerprint.
	// Profiles with a smaller width produce browser windows that may not fit on
	// the operator's physical display. Default: 1920.
	MinScreenWidth int

	// MinScreenHeight is the minimum screen height for the generated fingerprint.
	// Default: 1080.
	MinScreenHeight int

	// MaxScreenWidth is the maximum screen width. Default: 1920.
	MaxScreenWidth int

	// MaxScreenHeight is the maximum screen height. Default: 1080.
	MaxScreenHeight int
}

PatchProfileForProxyOptions configures the behaviour of PatchProfileForProxy.

type PatchProfileRequest

type PatchProfileRequest struct {
	ProfileID        string             `json:"profile_id"`
	Name             string             `json:"name,omitempty"`
	AutoUpdateCore   *bool              `json:"auto_update_core,omitempty"`
	CoreVersion      int                `json:"core_version,omitempty"`
	CoreMinorVersion int                `json:"core_minor_version,omitempty"`
	Proxy            *Proxy             `json:"proxy,omitempty"`
	CustomStartURLs  []string           `json:"custom_start_urls,omitempty"`
	Notes            string             `json:"notes,omitempty"`
	Parameters       *ProfileParameters `json:"parameters,omitempty"`
	Tags             []string           `json:"tags,omitempty"`
}

PatchProfileRequest partially updates a profile.

type PollOptions

type PollOptions struct {
	InitialInterval time.Duration
	MaxInterval     time.Duration
	Timeout         time.Duration
	Multiplier      float64
}

PollOptions controls retry/backoff behavior for launcher polling helpers.

type Profile

type Profile struct {
	ID                string `json:"id"`
	Name              string `json:"name"`
	FolderID          string `json:"folder_id"`
	ABPStatus         bool   `json:"abp_status"`
	BrowserType       string `json:"browser_type"`
	OSType            string `json:"os_type"`
	CoreVersion       int    `json:"core_version"`
	Notes             string `json:"notes"`
	CreatedBy         string `json:"created_by"`
	CreatedAt         string `json:"created_at"`
	InUseBy           string `json:"in_use_by"`
	LockedBy          string `json:"locked_by"`
	LastLaunchedAt    string `json:"last_launched_at"`
	LastLaunchedBy    string `json:"last_launched_by"`
	LastLaunchedOn    string `json:"last_launched_on"`
	UpdatedAt         string `json:"updated_at"`
	PasswordProtected bool   `json:"password_protected"`
	IsLocal           bool   `json:"is_local"`
}

Profile is the lightweight profile view returned by search.

type ProfileBatchFailure

type ProfileBatchFailure struct {
	ProfileName string
	Err         error
}

ProfileBatchFailure records one failed profile operation.

type ProfileFlags

type ProfileFlags struct {
	AudioMasking        string `json:"audio_masking,omitempty"`
	FontsMasking        string `json:"fonts_masking,omitempty"`
	GeolocationMasking  string `json:"geolocation_masking,omitempty"`
	GeolocationPopup    string `json:"geolocation_popup,omitempty"`
	GraphicsMasking     string `json:"graphics_masking,omitempty"`
	GraphicsNoise       string `json:"graphics_noise,omitempty"`
	LocalizationMasking string `json:"localization_masking,omitempty"`
	MediaDevicesMasking string `json:"media_devices_masking,omitempty"`
	NavigatorMasking    string `json:"navigator_masking,omitempty"`
	PortsMasking        string `json:"ports_masking,omitempty"`
	ProxyMasking        string `json:"proxy_masking,omitempty"`
	QuicMode            string `json:"quic_mode,omitempty"`
	ScreenMasking       string `json:"screen_masking,omitempty"`
	TimezoneMasking     string `json:"timezone_masking,omitempty"`
	WebRTCMasking       string `json:"webrtc_masking,omitempty"`
	CanvasNoise         string `json:"canvas_noise,omitempty"`
	StartupBehavior     string `json:"startup_behavior,omitempty"`
}

ProfileFlags contains the fingerprint masking flags used by profile create/update APIs.

type ProfileMeta

type ProfileMeta struct {
	ID             string             `json:"id"`
	Name           string             `json:"name"`
	Notes          string             `json:"notes"`
	BrowserType    string             `json:"browser_type"`
	CoreVersion    int                `json:"core_version"`
	IsAutoUpdate   bool               `json:"is_auto_update"`
	IsLocal        bool               `json:"is_local"`
	OSType         string             `json:"os_type"`
	FolderID       string             `json:"folder_id"`
	WorkspaceID    string             `json:"workspace_id"`
	CreatedAt      string             `json:"created_at"`
	CreatedBy      string             `json:"created_by"`
	InUseBy        string             `json:"in_use_by"`
	LastLaunchedAt string             `json:"last_launched_at"`
	LastLaunchedBy string             `json:"last_launched_by"`
	LastLaunchedOn string             `json:"last_launched_on"`
	LastUpdatedAt  string             `json:"last_update_at"`
	LastUpdatedBy  string             `json:"last_updated_by"`
	RemovedAt      string             `json:"removed_at"`
	RemovedBy      string             `json:"removed_by"`
	Status         string             `json:"status"`
	Parameters     *ProfileParameters `json:"parameters,omitempty"`
}

ProfileMeta is a detailed profile metadata record.

func (*ProfileMeta) CheckLocal

func (m *ProfileMeta) CheckLocal() bool

CheckLocal returns the confirmed local/cloud storage signal for a profile meta.

It intentionally ignores the top-level `ProfileMeta.IsLocal` field because live MLX responses from `/profile/metas` returned incorrect values for real local profiles. When storage parameters are absent, this helper returns false instead of falling back to the buggy top-level flag.

type ProfileMetasData

type ProfileMetasData struct {
	Profiles []ProfileMeta `json:"profiles"`
}

ProfileMetasData contains detailed profile metadata records.

type ProfileMetasRequest

type ProfileMetasRequest struct {
	IDs []string `json:"ids"`
}

ProfileMetasRequest requests metadata for profiles.

type ProfileMetasResponse

type ProfileMetasResponse struct {
	Status Status           `json:"status"`
	Data   ProfileMetasData `json:"data"`
}

ProfileMetasResponse returns detailed profile metadata.

func (*ProfileMetasResponse) GetStatus

func (r *ProfileMetasResponse) GetStatus() Status

type ProfileObjectUsage

type ProfileObjectUsage struct {
	ID        string          `json:"id"`
	Name      string          `json:"name"`
	Type      string          `json:"type"`
	MetaInfo  json.RawMessage `json:"meta_info"`
	IsEnabled bool            `json:"is_enabled"`
}

ProfileObjectUsage describes one object associated with a profile.

type ProfileObjectUsagesRequest

type ProfileObjectUsagesRequest struct {
	ObjectType string `json:"object_type"`
	ProfileID  string `json:"profile_id"`
}

ProfileObjectUsagesRequest queries resource usages for a profile and object type.

type ProfileObjectUsagesResponse

type ProfileObjectUsagesResponse struct {
	Status Status               `json:"status"`
	Data   []ProfileObjectUsage `json:"data"`
}

ProfileObjectUsagesResponse lists objects associated with one profile.

func (*ProfileObjectUsagesResponse) GetStatus

func (r *ProfileObjectUsagesResponse) GetStatus() Status

type ProfileParameters

type ProfileParameters struct {
	Flags           *ProfileFlags `json:"flags,omitempty"`
	Storage         *Storage      `json:"storage,omitempty"`
	Fingerprint     *Fingerprint  `json:"fingerprint,omitempty"`
	Proxy           *Proxy        `json:"proxy,omitempty"`
	CustomStartURLs []string      `json:"custom_start_urls,omitempty"`
}

ProfileParameters contains flags, storage, proxy, and fingerprint settings.

type ProfileRuntimeStatus

type ProfileRuntimeStatus struct {
	ProfileID      string `json:"profile_id"`
	Name           string `json:"name"`
	Status         string `json:"status"`
	BrowserType    string `json:"browser_type"`
	CoreVersion    int    `json:"core_version"`
	FolderID       string `json:"folder_id"`
	WorkspaceID    string `json:"workspace_id"`
	InUseBy        string `json:"in_use_by"`
	LastLaunchedAt string `json:"last_launched_at"`
	LastLaunchedBy string `json:"last_launched_by"`
	LastLaunchedOn string `json:"last_launched_on"`
	Message        string `json:"message"`
	IsQuick        bool   `json:"is_quick"`
	Timestamp      int64  `json:"timestamp"`
}

ProfileRuntimeStatus describes the running state of one profile.

type ProfileRuntimeStatusResponse

type ProfileRuntimeStatusResponse struct {
	Status Status               `json:"status"`
	Data   ProfileRuntimeStatus `json:"data"`
}

ProfileRuntimeStatusResponse contains a single profile status.

func (*ProfileRuntimeStatusResponse) GetStatus

func (r *ProfileRuntimeStatusResponse) GetStatus() Status

type ProfileSummary

type ProfileSummary struct {
	Fonts          []string                 `json:"fonts,omitempty"`
	Geolocation    *GeolocationFingerprint  `json:"geolocation,omitempty"`
	Graphic        *GraphicFingerprint      `json:"graphic,omitempty"`
	Localization   *LocalizationFingerprint `json:"localization,omitempty"`
	MaskingOptions map[string]any           `json:"masking_options,omitempty"`
	MediaDevices   *MediaDevicesFingerprint `json:"media_devices,omitempty"`
	Navigator      *NavigatorFingerprint    `json:"navigator,omitempty"`
	Ports          []int                    `json:"ports,omitempty"`
	Screen         *ScreenFingerprint       `json:"screen,omitempty"`
	Timezone       *TimezoneFingerprint     `json:"timezone,omitempty"`
	WebRTC         *WebRTCFingerprint       `json:"webrtc,omitempty"`
}

ProfileSummary contains ready-to-start fingerprint summary information.

type ProfileSummaryResponse

type ProfileSummaryResponse struct {
	Status Status         `json:"status"`
	Data   ProfileSummary `json:"data"`
}

ProfileSummaryResponse contains fingerprint summary details.

func (*ProfileSummaryResponse) GetStatus

func (r *ProfileSummaryResponse) GetStatus() Status

type ProfilesServiceOp

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

ProfilesServiceOp is the concrete ProfilesService implementation.

func (*ProfilesServiceOp) Clone

func (*ProfilesServiceOp) Create

func (*ProfilesServiceOp) Delete

func (*ProfilesServiceOp) FindByName

func (s *ProfilesServiceOp) FindByName(ctx context.Context, profileName string, opts *FindProfileOptions) (*Profile, *Response, error)

func (*ProfilesServiceOp) GetMeta

func (s *ProfilesServiceOp) GetMeta(ctx context.Context, profileID string) (*ProfileMeta, *Response, error)

func (*ProfilesServiceOp) GetMetas

func (*ProfilesServiceOp) GetSummary

func (s *ProfilesServiceOp) GetSummary(ctx context.Context, metaID string) (*ProfileSummaryResponse, *Response, error)

func (*ProfilesServiceOp) Move

func (*ProfilesServiceOp) Patch

func (*ProfilesServiceOp) Restore

func (*ProfilesServiceOp) Search

func (*ProfilesServiceOp) Update

type Proxy

type Proxy struct {
	Host             string `json:"host,omitempty"`
	Type             string `json:"type,omitempty"`
	Port             int    `json:"port,omitempty"`
	Username         string `json:"username,omitempty"`
	Password         string `json:"password,omitempty"`
	SaveTraffic      bool   `json:"save_traffic,omitempty"`
	Country          string `json:"country,omitempty"`
	Region           string `json:"region,omitempty"`
	City             string `json:"city,omitempty"`
	SessionID        string `json:"session_id,omitempty"`
	Provider         string `json:"provider,omitempty"`
	ConnectionString string `json:"connection_string,omitempty"`
	RetentionKey     string `json:"retention_key,omitempty"`
	RetentionSecret  string `json:"retention_secret,omitempty"`
}

Proxy contains proxy settings.

func BuildProfileProxyFromGenerated

func BuildProfileProxyFromGenerated(conn *GeneratedProxyConnection) *Proxy

BuildProfileProxyFromGenerated converts a parsed connection into a profile proxy payload.

Example
package main

import (
	"fmt"

	mlx "github.com/minskyagenda0708-cmd/mlx-go-sdk"
)

func main() {
	conn, _ := mlx.ParseGeneratedProxyConnection(
		"gate.multilogin.com:1080:2235470499_bc98e4f8_multilogin_com-country-us-region-new_jersey-city-east_brunswick-sid-demo:secret",
		mlx.ProxyProtocolSOCKS5,
	)
	proxy := mlx.BuildProfileProxyFromGenerated(conn)

	fmt.Println(proxy.Type)
	fmt.Println(proxy.Country, proxy.Region, proxy.City)
}
Output:
socks5
us new_jersey east_brunswick

type ProxyCheckResult

type ProxyCheckResult struct {
	Alive     bool   // true if at least one target responded within the timeout
	LatencyMs int    // best (minimum) time-to-first-byte across targets, in ms
	Target    string // the target URL that produced the best measurement
	Err       error  // last error encountered, if Alive is false
}

ProxyCheckResult is the outcome of a single proxy health check.

type ProxyChecker

type ProxyChecker interface {
	Check(ctx context.Context, p *Proxy) ProxyCheckResult
}

ProxyChecker measures whether a proxy is alive and how fast it is.

The default implementation is HTTPProxyChecker. The interface exists so a JA3/TLS-impersonating checker can be substituted later without changing callers such as EnsureHealthyProxy.

type ProxyProtocol

type ProxyProtocol string

ProxyProtocol identifies the upstream proxy protocol.

const (
	ProxyProtocolSOCKS5 ProxyProtocol = "socks5"
	ProxyProtocolHTTP   ProxyProtocol = "http"
)

type ProxyService

ProxyService manages MLX profile-proxy workflows.

type ProxyServiceOp

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

ProxyServiceOp is the concrete proxy service implementation.

func (*ProxyServiceOp) BuildProfileProxy

func (s *ProxyServiceOp) BuildProfileProxy(conn *GeneratedProxyConnection) *Proxy

BuildProfileProxy converts a parsed generated connection into the profile-bound proxy payload.

func (*ProxyServiceOp) EnsureHealthyProxy

func (s *ProxyServiceOp) EnsureHealthyProxy(ctx context.Context, current *Proxy, opts EnsureHealthyProfileProxyOptions) (*Proxy, bool, error)

EnsureHealthyProxy verifies current and finds a geo-preserving replacement if needed.

func (*ProxyServiceOp) Generate

Generate requests MLX-managed proxies and parses the returned connection strings.

func (*ProxyServiceOp) GenerateProfileProxy

GenerateProfileProxy generates one proxy connection and converts it into a profile payload.

func (*ProxyServiceOp) GetUsage

GetUsage returns proxy traffic data for the authenticated account.

func (*ProxyServiceOp) ParseConnectionString

func (s *ProxyServiceOp) ParseConnectionString(raw string, protocol ProxyProtocol) (*GeneratedProxyConnection, error)

ParseConnectionString parses the MLX connection string into a typed proxy model.

type ProxySessionType

type ProxySessionType string

ProxySessionType identifies whether generated proxy credentials are sticky or rotating.

const (
	ProxySessionSticky   ProxySessionType = "sticky"
	ProxySessionRotating ProxySessionType = "rotating"
)

type ProxyUsageResponse

type ProxyUsageResponse struct {
	Traffic   int64  `json:"traffic"`
	BillingID string `json:"billingId"`
}

ProxyUsageResponse reports proxy traffic usage for the authenticated account.

type ProxyValidationData

type ProxyValidationData struct {
	Accuracy    float64 `json:"accuracy"`
	Altitude    float64 `json:"altitude"`
	CountryCode string  `json:"country_code"`
	IP          string  `json:"ip"`
	Latitude    float64 `json:"latitude"`
	Longitude   float64 `json:"longitude"`
	Timezone    string  `json:"timezone"`
}

ProxyValidationData contains geolocation and accuracy data for a proxy.

type QuickProfileRuntimeStatus

type QuickProfileRuntimeStatus struct {
	Name        string `json:"name"`
	Status      string `json:"status"`
	Message     string `json:"message"`
	BrowserType string `json:"browser_type"`
	IsQuick     bool   `json:"is_quick"`
	Timestamp   int64  `json:"timestamp"`
}

QuickProfileRuntimeStatus describes quick profile state.

type QuickProfileStatusesData

type QuickProfileStatusesData struct {
	ActiveCounter int                                  `json:"active_counter"`
	States        map[string]QuickProfileRuntimeStatus `json:"states"`
}

QuickProfileStatusesData wraps quick profile states.

type QuickProfileStatusesResponse

type QuickProfileStatusesResponse struct {
	Status Status                   `json:"status"`
	Data   QuickProfileStatusesData `json:"data"`
}

QuickProfileStatusesResponse contains quick profile states.

func (*QuickProfileStatusesResponse) GetStatus

func (r *QuickProfileStatusesResponse) GetStatus() Status

type RemoveTagsRequest

type RemoveTagsRequest struct {
	IDs []string `json:"ids"`
}

RemoveTagsRequest removes tags.

type ResourceMeta

type ResourceMeta struct {
	ID             string `json:"id"`
	ObjectTypeID   string `json:"object_type_id"`
	ObjectName     string `json:"object_name"`
	ObjectSize     int64  `json:"object_size"`
	CurrentVersion string `json:"current_version"`
	CreatedAt      string `json:"created_at"`
	CreatedBy      string `json:"created_by"`
	UpdateAt       string `json:"update_at"`
	UpdateBy       string `json:"update_by"`
	StorageType    string `json:"storage_type"`
	MetaInfo       string `json:"meta_info"`
	IsDefault      bool   `json:"is_default"`
	IsInTrashbin   bool   `json:"is_in_trashbin"`
}

ResourceMeta describes one resource object metadata record.

type ResourceMetaResponse

type ResourceMetaResponse struct {
	Status Status       `json:"status"`
	Data   ResourceMeta `json:"data"`
}

ResourceMetaResponse returns one resource object metadata record.

func (*ResourceMetaResponse) GetStatus

func (r *ResourceMetaResponse) GetStatus() Status

type ResourceMetasData

type ResourceMetasData struct {
	Objects []ResourceMeta `json:"objects"`
}

ResourceMetasData wraps listed resource objects.

type ResourceMetasResponse

type ResourceMetasResponse struct {
	Status Status            `json:"status"`
	Data   ResourceMetasData `json:"data"`
}

ResourceMetasResponse contains listed resource objects.

func (*ResourceMetasResponse) GetStatus

func (r *ResourceMetasResponse) GetStatus() Status

type ResourceType

type ResourceType struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ResourceType identifies one resource object type.

type ResourceTypesData

type ResourceTypesData struct {
	Types []ResourceType `json:"types"`
}

ResourceTypesData wraps available resource object types.

type ResourceTypesResponse

type ResourceTypesResponse struct {
	Status Status            `json:"status"`
	Data   ResourceTypesData `json:"data"`
}

ResourceTypesResponse contains available resource object types.

func (*ResourceTypesResponse) GetStatus

func (r *ResourceTypesResponse) GetStatus() Status

type ResourcesService

type ResourcesService interface {
	ListTypes(context.Context) (*ResourceTypesResponse, *Response, error)
	ListMetas(context.Context, *ListResourceMetasOptions) (*ResourceMetasResponse, *Response, error)
	ListProfileTemplates(context.Context, *ListResourceMetasOptions) (*ResourceMetasResponse, *Response, error)
	ListExtensions(context.Context, *ListResourceMetasOptions) (*ResourceMetasResponse, *Response, error)
	GetMeta(context.Context, string) (*ResourceMetaResponse, *Response, error)
	Delete(context.Context, string, bool) (*EmptyDataResponse, *Response, error)
	Restore(context.Context, string) (*EmptyDataResponse, *Response, error)
	ObjectProfileUsages(context.Context, string) (*ObjectProfileUsagesResponse, *Response, error)
	ProfileObjectUsages(context.Context, *ProfileObjectUsagesRequest) (*ProfileObjectUsagesResponse, *Response, error)
	ProfileExtensionUsages(context.Context, string) (*ProfileObjectUsagesResponse, *Response, error)
	Upload(context.Context, *UploadObjectRequest) (*CreateAndUploadObjectResponse, *Response, error)
	CreateAndUpload(context.Context, *CreateAndUploadObjectRequest) (*CreateAndUploadObjectResponse, *Response, error)
	CreateProfileTemplate(context.Context, *CreateProfileTemplateRequest) (*CreateAndUploadObjectResponse, *Response, error)
	UploadExtension(context.Context, *UploadExtensionRequest) (*CreateAndUploadObjectResponse, *Response, error)
	LocalToCloud(context.Context, *LocalToCloudObjectRequest) (*CreateAndUploadObjectResponse, *Response, error)
	CreateExtensionFromURL(context.Context, *CreateExtensionFromURLRequest) (*EmptyDataResponse, *Response, error)
	CreateExtensionFromChromeWebStore(context.Context, *CreateChromeWebStoreExtensionRequest) (*EmptyDataResponse, *Response, error)
	EnableExtensionForProfiles(context.Context, string, *SetResourceProfilesRequest) (*StringDataResponse, *Response, error)
	DisableExtensionForProfiles(context.Context, string, *SetResourceProfilesRequest) (*StringDataResponse, *Response, error)
	Download(context.Context, string) (*DownloadResourceResponse, *Response, error)
}

ResourcesService manages template/resource objects backed by Multilogin resources and launcher object storage.

type ResourcesServiceOp

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

ResourcesServiceOp is the concrete resources service implementation.

func (*ResourcesServiceOp) CreateAndUpload

func (*ResourcesServiceOp) CreateExtensionFromChromeWebStore

func (s *ResourcesServiceOp) CreateExtensionFromChromeWebStore(ctx context.Context, reqBody *CreateChromeWebStoreExtensionRequest) (*EmptyDataResponse, *Response, error)

func (*ResourcesServiceOp) CreateExtensionFromURL

func (s *ResourcesServiceOp) CreateExtensionFromURL(ctx context.Context, reqBody *CreateExtensionFromURLRequest) (*EmptyDataResponse, *Response, error)

func (*ResourcesServiceOp) CreateProfileTemplate

func (*ResourcesServiceOp) Delete

func (s *ResourcesServiceOp) Delete(ctx context.Context, resourceID string, permanently bool) (*EmptyDataResponse, *Response, error)

func (*ResourcesServiceOp) DisableExtensionForProfiles

func (s *ResourcesServiceOp) DisableExtensionForProfiles(ctx context.Context, resourceID string, reqBody *SetResourceProfilesRequest) (*StringDataResponse, *Response, error)

func (*ResourcesServiceOp) Download

func (s *ResourcesServiceOp) Download(ctx context.Context, resourceID string) (*DownloadResourceResponse, *Response, error)

func (*ResourcesServiceOp) EnableExtensionForProfiles

func (s *ResourcesServiceOp) EnableExtensionForProfiles(ctx context.Context, resourceID string, reqBody *SetResourceProfilesRequest) (*StringDataResponse, *Response, error)

func (*ResourcesServiceOp) GetMeta

func (s *ResourcesServiceOp) GetMeta(ctx context.Context, resourceID string) (*ResourceMetaResponse, *Response, error)

func (*ResourcesServiceOp) ListExtensions

func (*ResourcesServiceOp) ListMetas

func (*ResourcesServiceOp) ListProfileTemplates

func (*ResourcesServiceOp) ListTypes

func (*ResourcesServiceOp) LocalToCloud

func (*ResourcesServiceOp) ObjectProfileUsages

func (s *ResourcesServiceOp) ObjectProfileUsages(ctx context.Context, objectID string) (*ObjectProfileUsagesResponse, *Response, error)

func (*ResourcesServiceOp) ProfileExtensionUsages

func (s *ResourcesServiceOp) ProfileExtensionUsages(ctx context.Context, profileID string) (*ProfileObjectUsagesResponse, *Response, error)

func (*ResourcesServiceOp) ProfileObjectUsages

func (*ResourcesServiceOp) Restore

func (s *ResourcesServiceOp) Restore(ctx context.Context, resourceID string) (*EmptyDataResponse, *Response, error)

func (*ResourcesServiceOp) Upload

func (*ResourcesServiceOp) UploadExtension

type Response

type Response struct {
	Status Status
	Raw    any
}

Response wraps an HTTP response together with the decoded status envelope.

type RestoreProfilesRequest

type RestoreProfilesRequest struct {
	IDs []string `json:"ids"`
}

RestoreProfilesRequest restores soft-deleted profiles.

type RetryOptions

type RetryOptions struct {
	MaxAttempts     int
	InitialInterval time.Duration
	MaxInterval     time.Duration
	Multiplier      float64
	Jitter          float64
	ShouldRetry     func(error) bool
	Rand            *rand.Rand
}

RetryOptions controls transport-level retry/backoff behavior.

type SaveQuickProfileItem

type SaveQuickProfileItem struct {
	ProfileID string `json:"profile_id"`
}

SaveQuickProfileItem identifies a quick profile to save.

type SaveQuickProfileRequest

type SaveQuickProfileRequest struct {
	Data []SaveQuickProfileItem `json:"data"`
}

SaveQuickProfileRequest configures saving quick profiles.

type ScreenFingerprint

type ScreenFingerprint struct {
	Height     int     `json:"height,omitempty"`
	PixelRatio float64 `json:"pixel_ratio,omitempty"`
	Width      int     `json:"width,omitempty"`
}

ScreenFingerprint contains screen-related values.

func PickScreenResolution

func PickScreenResolution(opts PatchProfileForProxyOptions) *ScreenFingerprint

PickScreenResolution selects a believable screen resolution within opts bounds (defaults: 1920x1080). Exposed for CLI flag-based profile creation.

type SearchProfilesData

type SearchProfilesData struct {
	Profiles   []Profile `json:"profiles"`
	TotalCount int       `json:"total_count"`
}

SearchProfilesData contains a page of profiles.

type SearchProfilesRequest

type SearchProfilesRequest struct {
	IsRemoved   bool     `json:"is_removed"`
	Limit       int      `json:"limit"`
	Offset      int      `json:"offset"`
	SearchText  string   `json:"search_text"`
	StorageType string   `json:"storage_type"`
	FolderID    string   `json:"folder_id,omitempty"`
	BrowserType string   `json:"browser_type,omitempty"`
	OSType      string   `json:"os_type,omitempty"`
	OrderBy     string   `json:"order_by,omitempty"`
	Sort        string   `json:"sort,omitempty"`
	CoreVersion int      `json:"core_version,omitempty"`
	Tags        []string `json:"tags,omitempty"`
}

SearchProfilesRequest searches profiles.

type SearchProfilesResponse

type SearchProfilesResponse struct {
	Status Status             `json:"status"`
	Data   SearchProfilesData `json:"data"`
}

SearchProfilesResponse contains search results.

func (*SearchProfilesResponse) GetStatus

func (r *SearchProfilesResponse) GetStatus() Status

type SearchTagsData

type SearchTagsData struct {
	Tags       []Tag `json:"tags"`
	TotalCount int   `json:"total_count"`
}

SearchTagsData wraps the list of tags and total count.

type SearchTagsRequest

type SearchTagsRequest struct {
	SearchText string `json:"search_text"`
	Limit      int    `json:"limit"`
	Offset     int    `json:"offset"`
	OrderBy    string `json:"order_by"`
	Sort       string `json:"sort"`
}

SearchTagsRequest searches tags.

type SearchTagsResponse

type SearchTagsResponse struct {
	Status Status         `json:"status"`
	Data   SearchTagsData `json:"data"`
}

SearchTagsResponse contains tag search results.

func (*SearchTagsResponse) GetStatus

func (r *SearchTagsResponse) GetStatus() Status

GetStatus implements the status getter interface.

type SeedProfileCookiesOptions

type SeedProfileCookiesOptions struct {
	ProfileID               string
	FolderID                string
	TargetWebsite           string
	AdditionalWebsite       string
	CreateMetadataIfMissing bool
	StrictMode              bool
	ImportAdvancedCookies   bool
	CookieBundleIndex       int
}

SeedProfileCookiesOptions configures the high-level cookie seeding helper.

type SeedProfileCookiesResult

type SeedProfileCookiesResult struct {
	MetadataCreated bool
	MetadataUpdated bool
	ProfileID       string
	FolderID        string
	TargetWebsite   string
	CookieCount     int
	SelectedBundle  *CookieBundle
	ImportResponse  *EmptyDataResponse
}

SeedProfileCookiesResult contains the outcome of metadata creation/update, cookie selection, and import.

type SetResourceProfilesRequest

type SetResourceProfilesRequest struct {
	ProfileIDs []string `json:"profile_ids"`
}

SetResourceProfilesRequest enables or disables a resource for a set of profiles.

type StartProfileAutomationByNameOptions

type StartProfileAutomationByNameOptions struct {
	FindOptions    *FindProfileOptions
	StartOptions   StartProfileOptions
	WaitForRunning bool
	PollOptions    PollOptions
}

StartProfileAutomationByNameOptions controls lookup, automation normalization, and endpoint resolution.

type StartProfileByNameOptions

type StartProfileByNameOptions struct {
	FindOptions    *FindProfileOptions
	StartOptions   StartProfileOptions
	WaitForRunning bool
	PollOptions    PollOptions
}

StartProfileByNameOptions controls the lookup and launcher behavior for a start workflow.

type StartProfileOptions

type StartProfileOptions struct {
	AutomationType AutomationType
	Headless       bool
	StrictMode     bool
}

StartProfileOptions configures profile start requests.

type StartProfileResponse

type StartProfileResponse struct {
	Status Status             `json:"status"`
	Data   StartedProfileData `json:"data"`
}

StartProfileResponse contains the launcher port and runtime profile info.

func (*StartProfileResponse) GetStatus

func (r *StartProfileResponse) GetStatus() Status

type StartQuickProfileRequest

type StartQuickProfileRequest struct {
	BrowserType      string             `json:"browser_type,omitempty"`
	OSType           string             `json:"os_type,omitempty"`
	ScriptFile       string             `json:"script_file,omitempty"`
	AutomationType   AutomationType     `json:"automation,omitempty"`
	CoreVersion      int                `json:"core_version,omitempty"`
	CoreMinorVersion int                `json:"core_minor_version,omitempty"`
	Headless         bool               `json:"is_headless,omitempty"`
	Parameters       *ProfileParameters `json:"parameters,omitempty"`
	CustomStartURLs  []string           `json:"custom_start_urls,omitempty"`
}

StartQuickProfileRequest configures a quick profile start.

type StartQuickProfileResponse

type StartQuickProfileResponse struct {
	Status Status             `json:"status"`
	Data   StartedProfileData `json:"data"`
}

StartQuickProfileResponse contains the launcher port and runtime info for a quick profile.

func (*StartQuickProfileResponse) GetStatus

func (r *StartQuickProfileResponse) GetStatus() Status

type StartedProfileAutomationWorkflowResult

type StartedProfileAutomationWorkflowResult struct {
	Profile             *Profile
	StartResponse       *StartProfileResponse
	RuntimeStatus       *ProfileRuntimeStatusResponse
	RequestedAutomation AutomationType
	LauncherAutomation  AutomationType
	CDPPort             string
	CDPWebSocketURL     string
	RodControlURL       string
}

StartedProfileAutomationWorkflowResult contains the resolved profile, launcher results, and CDP endpoints.

type StartedProfileData

type StartedProfileData struct {
	BrowserType         string         `json:"browser_type"`
	CoreVersion         int            `json:"core_version"`
	ID                  string         `json:"id"`
	IsQuick             bool           `json:"is_quick"`
	Port                string         `json:"port"`
	RequestedAutomation AutomationType `json:"requested_automation,omitempty"`
	LauncherAutomation  AutomationType `json:"launcher_automation,omitempty"`
	CDPPort             string         `json:"cdp_port,omitempty"`
}

StartedProfileData contains launcher startup output.

func (*StartedProfileData) ResolveCDPWebSocketURL

func (d *StartedProfileData) ResolveCDPWebSocketURL(ctx context.Context) (string, error)

func (*StartedProfileData) ResolveRodControlURL

func (d *StartedProfileData) ResolveRodControlURL(ctx context.Context) (string, error)

type StartedProfileWorkflowResult

type StartedProfileWorkflowResult struct {
	Profile       *Profile
	StartResponse *StartProfileResponse
	RuntimeStatus *ProfileRuntimeStatusResponse
}

StartedProfileWorkflowResult contains the resolved profile and launcher results.

type Status

type Status struct {
	ErrorCode string `json:"error_code"`
	HTTPCode  int    `json:"http_code"`
	Message   string `json:"message"`
}

Status is the common status envelope returned by MultiloginX endpoints.

type StopAllProfilesOptions

type StopAllProfilesOptions struct {
	Type string
}

StopAllProfilesOptions controls stop-all behavior.

type StopProfileByNameOptions

type StopProfileByNameOptions struct {
	FindOptions          *FindProfileOptions
	IgnoreAlreadyStopped bool
	WaitForStopped       bool
	PollOptions          PollOptions
}

StopProfileByNameOptions controls the lookup used before stopping a profile.

type StoppedProfileWorkflowResult

type StoppedProfileWorkflowResult struct {
	Profile       *Profile
	StopResponse  *EmptyDataResponse
	RuntimeStatus *ProfileRuntimeStatusResponse
}

StoppedProfileWorkflowResult contains the resolved profile and stop response.

type Storage

type Storage struct {
	IsLocal           bool `json:"is_local"`
	SaveServiceWorker bool `json:"save_service_worker,omitempty"`
}

Storage contains storage-related profile settings.

type StringDataResponse

type StringDataResponse struct {
	Status Status `json:"status"`
	Data   string `json:"data"`
}

StringDataResponse captures endpoints that return a simple string payload.

func (*StringDataResponse) GetStatus

func (r *StringDataResponse) GetStatus() Status

type Tag

type Tag struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Color      string `json:"color"`
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
	CreatedBy  string `json:"created_by"`
	InUseCount int    `json:"in_use_count"`
}

Tag describes a tag.

type TagsData

type TagsData struct {
	Tags []Tag `json:"tags"`
}

TagsData wraps the list of tags.

type TagsResponse

type TagsResponse struct {
	Status Status   `json:"status"`
	Data   TagsData `json:"data"`
}

TagsResponse contains tag results.

func (*TagsResponse) GetStatus

func (r *TagsResponse) GetStatus() Status

GetStatus implements the status getter interface.

type TagsServiceOp

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

TagsServiceOp is the concrete TagsService implementation.

func (*TagsServiceOp) AssignToProfiles

func (s *TagsServiceOp) AssignToProfiles(ctx context.Context, reqBody *AssignTagsRequest) (*EmptyDataResponse, *Response, error)

func (*TagsServiceOp) Create

func (s *TagsServiceOp) Create(ctx context.Context, reqBody *CreateTagsRequest) (*TagsResponse, *Response, error)

func (*TagsServiceOp) Remove

func (*TagsServiceOp) Search

func (*TagsServiceOp) Update

func (s *TagsServiceOp) Update(ctx context.Context, reqBody *UpdateTagsRequest) (*TagsResponse, *Response, error)

type TimeRangeFilter

type TimeRangeFilter struct {
	From *time.Time
	To   *time.Time
}

TimeRangeFilter is reused by search requests when needed later.

type TimezoneFingerprint

type TimezoneFingerprint struct {
	Zone string `json:"zone,omitempty"`
}

TimezoneFingerprint contains timezone settings.

type TransfersServiceOp

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

TransfersServiceOp is the concrete import/export service.

func (*TransfersServiceOp) Export

func (*TransfersServiceOp) ExportStatus

func (s *TransfersServiceOp) ExportStatus(ctx context.Context, exportID string) (*ExportStatusResponse, *Response, error)

func (*TransfersServiceOp) ExportStatuses

func (*TransfersServiceOp) Import

func (*TransfersServiceOp) ImportStatus

func (s *TransfersServiceOp) ImportStatus(ctx context.Context, importID string) (*ImportStatusResponse, *Response, error)

func (*TransfersServiceOp) ImportStatuses

func (*TransfersServiceOp) WaitForExportDone

func (s *TransfersServiceOp) WaitForExportDone(ctx context.Context, exportID string, opts PollOptions) (*ExportStatusResponse, *Response, error)

func (*TransfersServiceOp) WaitForImportDone

func (s *TransfersServiceOp) WaitForImportDone(ctx context.Context, importID string, opts PollOptions) (*ImportStatusResponse, *Response, error)

type TransportError

type TransportError struct {
	Request *http.Request
	Err     error
}

TransportError wraps network/transport failures from the underlying HTTP client.

func (*TransportError) Class

func (e *TransportError) Class() ErrorClass

Class returns the typed transport error category.

func (*TransportError) Error

func (e *TransportError) Error() string

func (*TransportError) Retryable

func (e *TransportError) Retryable() bool

Retryable reports whether retry/backoff helpers should retry the transport error.

func (*TransportError) Temporary

func (e *TransportError) Temporary() bool

Temporary reports whether the transport failure is likely transient.

func (*TransportError) Timeout

func (e *TransportError) Timeout() bool

Timeout reports whether the wrapped transport failure is a timeout.

func (*TransportError) Unwrap

func (e *TransportError) Unwrap() error

type UpdateCookiesMetadataRequest

type UpdateCookiesMetadataRequest struct {
	ProfileID         string `json:"profile_id"`
	TargetWebsite     string `json:"target_website"`
	AdditionalWebsite string `json:"additional_website,omitempty"`
	StrictMode        bool   `json:"-"`
}

UpdateCookiesMetadataRequest changes cookie metadata for a profile.

type UpdateFolderRequest

type UpdateFolderRequest struct {
	FolderID string `json:"folder_id"`
	Name     string `json:"name"`
	Comment  string `json:"comment,omitempty"`
}

UpdateFolderRequest updates a folder.

type UpdateProfileRequest

type UpdateProfileRequest struct {
	ProfileID        string             `json:"profile_id"`
	Name             string             `json:"name"`
	AutoUpdateCore   *bool              `json:"auto_update_core,omitempty"`
	CoreVersion      int                `json:"core_version,omitempty"`
	CoreMinorVersion int                `json:"core_minor_version,omitempty"`
	Parameters       *ProfileParameters `json:"parameters,omitempty"`
	Notes            string             `json:"notes,omitempty"`
	Tags             []string           `json:"tags,omitempty"`
}

UpdateProfileRequest fully updates a profile.

type UpdateTagItem

type UpdateTagItem struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Color string `json:"color"`
}

UpdateTagItem is a single tag to update.

type UpdateTagsRequest

type UpdateTagsRequest struct {
	Tags []UpdateTagItem `json:"tags"`
}

UpdateTagsRequest updates tags.

type UploadExtensionRequest

type UploadExtensionRequest struct {
	ObjectPath  string
	StorageType string
	ObjectMeta  string
	Encrypt     *bool
}

UploadExtensionRequest uploads an extension archive as a resource object.

Live validation showed that applying a local zip extension to a local profile works reliably when the extension object reference is cloud-backed, so this helper defaults StorageType to "cloud".

type UploadObjectRequest

type UploadObjectRequest struct {
	ObjectTypeID string `json:"object_type_id"`
	ObjectPath   string `json:"object_path"`
	StorageType  string `json:"storage_type"`
	ObjectMeta   string `json:"object_meta,omitempty"`
	Encrypt      *bool  `json:"encrypt,omitempty"`
}

UploadObjectRequest uploads an existing local object into launcher-backed storage.

type ValidateProxyRequest

type ValidateProxyRequest struct {
	Type     string `json:"type"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

ValidateProxyRequest configures proxy validation.

type ValidateProxyResponse

type ValidateProxyResponse struct {
	Status Status              `json:"status"`
	Data   ProxyValidationData `json:"data"`
}

ValidateProxyResponse contains proxy validation results.

func (*ValidateProxyResponse) GetStatus

func (r *ValidateProxyResponse) GetStatus() Status

type VerifiedProfileWorkflowResult

type VerifiedProfileWorkflowResult struct {
	Profile *Profile
	Meta    *ProfileMeta
}

VerifiedProfileWorkflowResult contains lightweight and meta profile views.

type WebRTCFingerprint

type WebRTCFingerprint struct {
	PublicIP string `json:"public_ip,omitempty"`
}

WebRTCFingerprint contains WebRTC information.

type WorkflowService

type WorkflowService interface {
	CreateProfilesAndVerify(context.Context, *CreateProfileRequest, CreateProfilesAndVerifyOptions) (*CreatedProfilesWorkflowResult, error)
	CreateLocalProfile(context.Context, *CreateProfileRequest, CreateProfilesAndVerifyOptions) (*CreatedProfilesWorkflowResult, error)
	CreateCloudProfile(context.Context, *CreateProfileRequest, CreateProfilesAndVerifyOptions) (*CreatedProfilesWorkflowResult, error)
	FindProfileByNameVerified(context.Context, string, FindProfileByNameVerifiedOptions) (*VerifiedProfileWorkflowResult, error)
	StartProfileAutomationByName(context.Context, string, StartProfileAutomationByNameOptions) (*StartedProfileAutomationWorkflowResult, error)
	StartProfileByName(context.Context, string, StartProfileByNameOptions) (*StartedProfileWorkflowResult, error)
	StartProfilesByName(context.Context, []string, StartProfileByNameOptions) (*BatchResult[StartedProfileWorkflowResult], error)
	StopProfileByName(context.Context, string, StopProfileByNameOptions) (*StoppedProfileWorkflowResult, error)
	StopProfilesByName(context.Context, []string, StopProfileByNameOptions) (*BatchResult[StoppedProfileWorkflowResult], error)
	ImportProfileAndVerify(context.Context, *ImportProfileRequest, ImportProfileWorkflowOptions) (*ImportedProfileWorkflowResult, error)
	EnableExtensionForProfileByName(context.Context, string, string, EnableExtensionForProfileByNameOptions) (*EnabledExtensionWorkflowResult, error)
	EnableExtensionForProfilesByName(context.Context, []string, string, EnableExtensionForProfileByNameOptions) (*BatchResult[EnabledExtensionWorkflowResult], error)
	ExportProfileByNameToFolder(context.Context, string, ExportProfileByNameToFolderOptions) (*ExportedProfileWorkflowResult, error)
	ExportProfilesByNameToFolder(context.Context, []string, ExportProfileByNameToFolderOptions) (*BatchResult[ExportedProfileWorkflowResult], error)
	GenerateProfileProxyByName(context.Context, string, GenerateProfileProxyByNameOptions) (*GeneratedProfileProxyWorkflowResult, error)
}

WorkflowService provides higher-level helpers that combine multiple SDK calls.

type WorkflowServiceOp

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

WorkflowServiceOp is the concrete high-level workflow service.

func (*WorkflowServiceOp) CreateCloudProfile

CreateCloudProfile creates a cloud profile by ensuring storage.is_local=false and then verifying creation.

func (*WorkflowServiceOp) CreateLocalProfile

CreateLocalProfile creates a local profile by ensuring storage.is_local=true and then verifying creation.

func (*WorkflowServiceOp) CreateProfilesAndVerify

CreateProfilesAndVerify creates profiles and waits until their metas are readable.

func (*WorkflowServiceOp) EnableExtensionForProfileByName

func (s *WorkflowServiceOp) EnableExtensionForProfileByName(ctx context.Context, profileName, extensionID string, opts EnableExtensionForProfileByNameOptions) (*EnabledExtensionWorkflowResult, error)

EnableExtensionForProfileByName enables an extension and verifies the object-to-profile binding.

func (*WorkflowServiceOp) EnableExtensionForProfilesByName

func (s *WorkflowServiceOp) EnableExtensionForProfilesByName(ctx context.Context, profileNames []string, extensionID string, opts EnableExtensionForProfileByNameOptions) (*BatchResult[EnabledExtensionWorkflowResult], error)

EnableExtensionForProfilesByName enables one extension across multiple profiles with aggregated failures.

func (*WorkflowServiceOp) ExportProfileByNameToFolder

func (s *WorkflowServiceOp) ExportProfileByNameToFolder(ctx context.Context, profileName string, opts ExportProfileByNameToFolderOptions) (*ExportedProfileWorkflowResult, error)

ExportProfileByNameToFolder resolves a profile by exact name and exports it into an organized folder.

func (*WorkflowServiceOp) ExportProfilesByNameToFolder

func (s *WorkflowServiceOp) ExportProfilesByNameToFolder(ctx context.Context, profileNames []string, opts ExportProfileByNameToFolderOptions) (*BatchResult[ExportedProfileWorkflowResult], error)

ExportProfilesByNameToFolder exports multiple profiles and aggregates per-profile failures.

func (*WorkflowServiceOp) FindProfileByNameVerified

func (s *WorkflowServiceOp) FindProfileByNameVerified(ctx context.Context, profileName string, opts FindProfileByNameVerifiedOptions) (*VerifiedProfileWorkflowResult, error)

func (*WorkflowServiceOp) GenerateProfileProxyByName

GenerateProfileProxyByName resolves a profile, generates an MLX-managed proxy, and optionally patches the profile.

func (*WorkflowServiceOp) ImportProfileAndVerify

ImportProfileAndVerify imports a profile archive and confirms the resulting profile meta is readable.

func (*WorkflowServiceOp) StartProfileAutomationByName

StartProfileAutomationByName resolves a profile by exact name, starts it with automation normalization, and returns resolved CDP endpoints.

func (*WorkflowServiceOp) StartProfileByName

func (s *WorkflowServiceOp) StartProfileByName(ctx context.Context, profileName string, opts StartProfileByNameOptions) (*StartedProfileWorkflowResult, error)

StartProfileByName resolves a profile by exact name, starts it, and optionally waits for running status.

func (*WorkflowServiceOp) StartProfilesByName

func (s *WorkflowServiceOp) StartProfilesByName(ctx context.Context, profileNames []string, opts StartProfileByNameOptions) (*BatchResult[StartedProfileWorkflowResult], error)

StartProfilesByName starts multiple profiles and aggregates per-profile failures.

func (*WorkflowServiceOp) StopProfileByName

func (s *WorkflowServiceOp) StopProfileByName(ctx context.Context, profileName string, opts StopProfileByNameOptions) (*StoppedProfileWorkflowResult, error)

StopProfileByName resolves a profile by exact name and stops it.

func (*WorkflowServiceOp) StopProfilesByName

func (s *WorkflowServiceOp) StopProfilesByName(ctx context.Context, profileNames []string, opts StopProfileByNameOptions) (*BatchResult[StoppedProfileWorkflowResult], error)

StopProfilesByName stops multiple profiles and aggregates per-profile failures.

Directories

Path Synopsis
cmd
mlx command
internal
cli

Jump to

Keyboard shortcuts

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