cli

package
v0.0.0-...-4b0fe41 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DocumentationURL is the URL for the Pinner CLI documentation.
	DocumentationURL = "https://docs.lumeweb.com"

	// TutorialCID is a sample v1 CID for use in tutorial examples.
	TutorialCID = "bafybeie7m2fsbt6sjtn7tymyb6sim7iiyz6szl4ethtn7anzx4frzfzipu"
)
View Source
const (
	FlagJSON    = "json"
	FlagVerbose = "verbose"
	FlagQuiet   = "quiet"
	FlagUnmask  = "unmask"
)

Global/Output flags

View Source
const (
	FlagAuthToken   = "auth-token"
	FlagEmail       = "email"
	FlagPassword    = "password"
	FlagFirstName   = "first-name"
	FlagLastName    = "last-name"
	FlagOTPCode     = "otp-code"
	FlagKeyName     = "key-name"
	FlagNoCreateKey = "no-create-key"
	FlagForce       = "force"
	FlagToken       = "token"
	FlagOTP         = "otp"
)

Authentication flags

View Source
const (
	FlagName        = "name"
	FlagWait        = "wait"
	FlagConfirm     = "confirm"
	FlagLimit       = "limit"
	FlagMemoryLimit = "memory-limit"
	FlagStatus      = "status"
	FlagWatch       = "watch"
	FlagFile        = "file"
	FlagParallel    = "parallel"
	FlagContinue    = "continue"
	FlagDryRun      = "dry-run"
	FlagSet         = "set"
	FlagClear       = "clear"
)

Operation flags

View Source
const (
	FlagDomain       = "domain"
	FlagTargetHash   = "target-hash"
	FlagTargetType   = "target-type"
	FlagDNSHosting   = "dns-hosting"
	FlagNoDNSHosting = "no-dns-hosting"
)

Websites flags

View Source
const (
	FlagZoneID      = "zone-id"
	FlagNameservers = "nameservers"
	FlagContent     = "content"
	FlagType        = "type"
	FlagTTL         = "ttl"
	FlagDisabled    = "disabled"
)

DNS flags

View Source
const (
	FlagPlanID        = "plan-id"
	FlagUserID        = "user-id"
	FlagDescription   = "description"
	FlagUploadLimit   = "upload-limit"
	FlagDownloadLimit = "download-limit"
	FlagStorageLimit  = "storage-limit"
	FlagAmount        = "amount"
	FlagCurrency      = "currency"
	FlagGatewayID     = "gateway-id"
	FlagPosition      = "position"
	FlagRetentionDays = "retention-days"
	FlagSource        = "source"
	FlagQuotaType     = "quota-type"
	FlagIsActive      = "is-active"
	FlagIsDefault     = "is-default"
	FlagIsPublic      = "is-public"
	FlagPrice         = "price"
	FlagCadence       = "cadence"
	FlagQuotaPlanID   = "quota-plan-id"
	FlagRollingDays   = "rolling-days"
	FlagAllowFree     = "allow-free"
	FlagPricelineID   = "priceline-id"
	FlagMode          = "mode"
	FlagDirection     = "direction"
	FlagOlderThan     = "older-than"
	FlagForceDelete   = "force-delete"
)

Admin command flags

View Source
const (
	CmdPriceLines         = "price-lines"
	CmdPricingPlans       = "pricing-plans"
	CmdPricingPlanPeriods = "pricing-plan-periods"
	CmdSubscribers        = "subscribers"
	CmdCredits            = "credits"
	CmdOverview           = "overview"
	CmdQuota              = "quota"
	CmdBilling            = "billing"
	CmdList               = "list"
	CmdGet                = "get"
	CmdCreate             = "create"
	CmdUpdate             = "update"
	CmdDelete             = "delete"
	CmdAddPlan            = "add-plan"
	CmdDeletePlan         = "delete-plan"
	CmdUpdatePlanPosition = "update-plan-position"
	CmdCancel             = "cancel"
	CmdAbortCancel        = "abort-cancel"
	CmdChangePlan         = "change-plan"
	CmdPause              = "pause"
	CmdResume             = "resume"
	CmdListGateway        = "list-gateway"
	CmdListUser           = "list-user"
	CmdRestore            = "restore"
	CmdPurge              = "purge"
	CmdUserBalance        = "user-balance"
	CmdUserDeletedCredits = "user-deleted-credits"
	CmdSetDefault         = "set-default"
	CmdReconcile          = "reconcile"
	CmdCleanup            = "cleanup"
	CmdPlans              = "plans"
	CmdAllowances         = "allowances"
	CmdUserConfigs        = "user-configs"
	CmdStats              = "stats"
	CmdReset              = "reset"
	CmdAdmin              = "admin"
	CmdSync               = "sync"
	CmdSyncAll            = "sync-all"
)

Admin command name constants

View Source
const (
	DryRunOptionName            = "Name"
	DryRunOptionWait            = "Wait for completion"
	DryRunOptionParallel        = "Parallel operations"
	DryRunOptionContinueOnError = "Continue on error"
	DryRunOptionConfirm         = "Confirmation required"
	DryRunOptionInputType       = "Input type"
	DryRunOptionPath            = "Path"
	DryRunOptionMemoryLimit     = "Memory limit"
	DryRunOptionCID             = "CID"
	DryRunOptionAction          = "Action"
	DryRunOptionKey             = "Key"
	DryRunOptionCurrentValue    = "Current value"
	DryRunOptionNewValue        = "New value"
	DryRunOptionDescription     = "Description"
)

Dry run option key constants

View Source
const ConfigValueNotSet = "(not set)"

Sentinel constant for unset configuration values

View Source
const DefaultUploadLimit = 100 * units.MiB

DefaultUploadLimit is the default upload limit in bytes (100MB).

View Source
const (
	FlagSecure = "secure"
)

Connection/Config flags

Variables

View Source
var (
	// Authentication errors
	ErrNotAuthenticated = errors.New("not authenticated")

	// Input validation errors
	ErrPathRequired   = errors.New("path is required")
	ErrCIDRequired    = errors.New("CID is required")
	ErrInvalidCID     = errors.New("invalid CID")
	ErrNoCIDsProvided = errors.New("no CIDs provided")

	// File system errors
	ErrFileNotFound      = errors.New("file not found")
	ErrDirectoryNotFound = errors.New("directory not found")
	ErrPermissionDenied  = errors.New("permission denied")

	// Pinning errors
	ErrPinNotFound   = errors.New("pin not found")
	ErrPinningFailed = errors.New("pinning failed")
	ErrStatusCheck   = errors.New("failed to check pin status")

	// Upload errors
	ErrUploadFailed      = errors.New("upload failed")
	ErrUploadInterrupted = errors.New("upload interrupted")

	// Network errors
	ErrNetworkTimeout   = errors.New("network timeout")
	ErrConnectionFailed = errors.New("connection failed")

	// Configuration errors
	ErrConfigNotFound = errors.New("configuration not found")
	ErrConfigInvalid  = errors.New("configuration invalid")

	// Operation errors
	ErrOperationFailed    = errors.New("operation failed")
	ErrOperationNotFound  = errors.New("operation not found")
	ErrServiceUnavailable = errors.New("service unavailable")
)

Predefined error types for consistent error handling across the CLI. Use errors.Is() to check for these errors instead of string matching.

Functions

func ApplySecureConfig

func ApplySecureConfig(cmd *cli.Command, cfgMgr config.Manager) bool

ApplySecureConfig applies secure flag configuration to the config manager and persists it. This should only be used for explicit configuration changes (e.g., setup wizard, config set). For runtime CLI flag overrides, use GetSecureSetting() instead. Deprecated: Use GetSecureSetting() for runtime overrides, or explicit SetSecure() with validation.

func BuildTutorialCommandsTable

func BuildTutorialCommandsTable(rootCmd *cli.Command) ([]string, [][]string)

BuildTutorialCommandsTable returns headers and rows for displaying tutorial commands.

func BuildTutorialExamplesTable

func BuildTutorialExamplesTable(rootCmd *cli.Command) ([]string, [][]string)

BuildTutorialExamplesTable returns headers and rows for displaying tutorial examples.

func ConfirmFlag

func ConfirmFlag() *cli.BoolFlag

ConfirmFlag returns a flag to skip confirmation prompts.

func ContentFlag

func ContentFlag() *cli.StringFlag

ContentFlag returns a flag for DNS record content.

func ContinueFlag

func ContinueFlag() *cli.BoolFlag

ContinueFlag returns a flag to continue on error.

func DNSHostingFlag

func DNSHostingFlag() *cli.BoolFlag

DNSHostingFlag returns a flag for enabling DNS hosting.

func DisabledFlag

func DisabledFlag() *cli.BoolFlag

DisabledFlag returns a flag for disabling DNS records.

func DomainFlag

func DomainFlag() *cli.StringFlag

DomainFlag returns a flag for the website domain.

func DryRunFlag

func DryRunFlag() *cli.BoolFlag

DryRunFlag returns a flag for dry-run mode.

func DryRunOption

func DryRunOption(key, value string) map[string]string

DryRunOption creates an option entry map for dry-run previews.

func FileFlag

func FileFlag() *cli.StringFlag

FileFlag returns a flag for reading CIDs from a file.

func ForceFlag

func ForceFlag() *cli.BoolFlag

ForceFlag returns a flag for forcing operations.

func FormatCurrency

func FormatCurrency(amount float64, code CurrencyCode) string

FormatCurrency formats an amount with the given currency code.

func FormatError

func FormatError(err error, verbose bool) string

FormatError converts an error into a user-friendly message. It checks the error chain for known error types using errors.Is(). In verbose mode, the full error chain is included.

func FormatUSD

func FormatUSD(amount float32) string

FormatUSD formats a USD amount.

func GetAuthToken

func GetAuthToken(cmd *cli.Command, cfgMgr config.Manager) string

GetAuthToken returns the auth token from command flag, environment variable, or config (in that order).

func GetJWTPurpose

func GetJWTPurpose(token string) (string, error)

GetJWTPurpose extracts the purpose from a JWT token's audience claim. Returns the audience value or empty string if decoding fails. API keys have audience="api", login tokens have audience="login".

func GetSecureSetting

func GetSecureSetting(cmd *cli.Command, cfgMgr config.Manager) bool

GetSecureSetting returns the secure setting from CLI flag or config. CLI flag takes precedence over config, but does NOT persist to disk. Returns the secure setting (true for HTTPS, false for HTTP).

func GlobalFlags

func GlobalFlags() []cli.Flag

GlobalFlags returns flags that are available to all commands.

func LimitFlag

func LimitFlag() *cli.IntFlag

LimitFlag returns a flag for limiting results.

func MemoryLimitFlag

func MemoryLimitFlag() *cli.Uint64Flag

MemoryLimitFlag returns a flag for setting the memory limit for CAR generation.

func NameFlag

func NameFlag(usage string) *cli.StringFlag

NameFlag returns a flag for setting a custom name.

func NameserversFlag

func NameserversFlag() *cli.StringFlag

NameserversFlag returns a flag for custom nameservers.

func NewRootCommand

func NewRootCommand() *cli.Command

NewRootCommand creates and returns the root CLI command.

func NoDNSHostingFlag

func NoDNSHostingFlag() *cli.BoolFlag

NoDNSHostingFlag returns a flag for disabling DNS hosting.

func ParallelFlag

func ParallelFlag() *cli.IntFlag

ParallelFlag returns a flag for setting parallel operation count.

func RenderDryRun

func RenderDryRun(output Output, preview DryRunPreview)

RenderDryRun renders a dry-run preview in a consistent format.

func Run

func Run(ctx context.Context, args []string) error

Run executes the CLI application with the given context and arguments.

func SecureFlag

func SecureFlag() *cli.BoolFlag

SecureFlag returns a flag for setting the secure flag for HTTPS connections.

func StatusFlag

func StatusFlag() *cli.StringFlag

StatusFlag returns a flag for filtering by pin status.

func TTLFlag

func TTLFlag() *cli.UintFlag

TTLFlag returns a flag for DNS record TTL.

func TargetHashFlag

func TargetHashFlag() *cli.StringFlag

TargetHashFlag returns a flag for the target CID.

func TargetTypeFlag

func TargetTypeFlag() *cli.StringFlag

TargetTypeFlag returns a flag for the target type.

func TypeFlag

func TypeFlag() *cli.StringFlag

TypeFlag returns a flag for DNS record type.

func WaitFlag

func WaitFlag() *cli.BoolFlag

WaitFlag returns a flag for waiting for operation completion.

func WatchFlag

func WatchFlag() *cli.BoolFlag

WatchFlag returns a flag for continuous monitoring of pins.

func WithTutorial

func WithTutorial(priority int, description, example string) map[string]interface{}

WithTutorial returns a metadata map with tutorial information for a command. This helper simplifies adding tutorial metadata to cli.Command definitions.

Example usage:

Metadata: WithTutorial(1, "Upload and pin a file", "pinner upload myfile.txt")

func WrapAuthError

func WrapAuthError(operation string, err error) error

WrapAuthError wraps an error with authentication context if it's an auth-related error. This provides consistent error messages across all services. Returns an error that includes both a human-readable message and the predefined error type for programmatic checking with errors.Is().

func WrapFileError

func WrapFileError(operation, path string, err error) error

WrapFileError wraps file-related errors with context about what operation failed.

func WrapNetworkError

func WrapNetworkError(operation string, err error) error

WrapNetworkError wraps errors with network troubleshooting hints.

func ZoneIDFlag

func ZoneIDFlag() *cli.StringFlag

ZoneIDFlag returns a flag for the DNS zone ID.

Types

type AdminTokenProvider

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

AdminTokenProvider handles token exchange for admin services. It detects API-purpose tokens and exchanges them for login-purpose tokens as needed.

func NewAdminTokenProvider

func NewAdminTokenProvider(cfgMgr config.Manager) *AdminTokenProvider

NewAdminTokenProvider creates a new AdminTokenProvider.

func (*AdminTokenProvider) GetLoginToken

func (p *AdminTokenProvider) GetLoginToken(ctx context.Context) (string, error)

GetLoginToken returns a login-purpose JWT token, exchanging an API token if necessary. The exchanged token is cached for subsequent calls.

func (*AdminTokenProvider) Invalidate

func (p *AdminTokenProvider) Invalidate()

Invalidate clears the cached login token, forcing re-exchange on next access.

type AuthInfo

type AuthInfo struct {
	Authenticated bool `json:"authenticated"`
}

AuthInfo contains authentication status information

type AuthPrompter

type AuthPrompter interface {
	// PromptEmail prompts for and validates an email address.
	PromptEmail() (string, error)

	// PromptPassword prompts for and validates a password (with masking).
	PromptPassword() (string, error)

	// Password prompts for a password with masking (no validation).
	Password(label string) (string, error)

	// PromptString prompts for a string value with a label.
	PromptString(label string) (string, error)

	// PromptOTP prompts for a 6-digit OTP code.
	PromptOTP() (string, error)
}

AuthPrompter defines the interface for interactive user input.

type AuthService

type AuthService interface {
	// LoginCheck validates credentials and returns login result (including intermediate JWT for 2FA).
	LoginCheck(ctx context.Context, email, password string) (*portalsdk.LoginResult, error)

	// CompleteLogin completes authentication with a final JWT token.
	CompleteLogin(ctx context.Context, token, keyName string, noCreateKey bool) error

	// LoginWithOTP completes 2FA authentication using an intermediate JWT and OTP code.
	LoginWithOTP(ctx context.Context, intermediateJWT, otp, keyName string, noCreateKey bool) error

	// Register creates a new user account.
	Register(ctx context.Context, email, firstName, lastName, password string) error

	// SaveToken saves a JWT token to the config.
	SaveToken(token string) error

	// GetAPIEndpoint returns the configured API endpoint.
	GetAPIEndpoint() string

	// EnableOTP enables two-factor authentication for the account.
	EnableOTP(ctx context.Context, otpCode string) error

	// DisableOTP disables two-factor authentication for the account.
	DisableOTP(ctx context.Context, password string) error

	// Status checks if the current auth token is valid.
	Status(ctx context.Context) error

	// GetAuthenticatedClient returns an authenticated account client.
	// If the stored token is an API key JWT, it exchanges it for a login JWT.
	GetAuthenticatedClient(ctx context.Context) (portalsdk.AccountAPI, error)
}

AuthService provides authentication operations. This interface allows mocking in tests.

func NewAuthService

func NewAuthService(configMgr config.Manager, output Output, apiEndpoint string, opts ...AuthServiceOption) AuthService

NewAuthService creates a new AuthService with the given dependencies. An account client will be created if not provided via WithAuthAccountClient option.

type AuthServiceDefault

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

AuthServiceDefault handles authentication business logic. It separates CLI concerns from authentication operations.

func (*AuthServiceDefault) CompleteLogin

func (s *AuthServiceDefault) CompleteLogin(ctx context.Context, token, keyName string, noCreateKey bool) error

CompleteLogin completes authentication with a final JWT token.

func (*AuthServiceDefault) DisableOTP

func (s *AuthServiceDefault) DisableOTP(ctx context.Context, password string) error

DisableOTP disables two-factor authentication for the account.

func (*AuthServiceDefault) EnableOTP

func (s *AuthServiceDefault) EnableOTP(ctx context.Context, otpCode string) error

EnableOTP enables two-factor authentication for the account.

func (*AuthServiceDefault) GetAPIEndpoint

func (s *AuthServiceDefault) GetAPIEndpoint() string

GetAPIEndpoint returns the configured API endpoint.

func (*AuthServiceDefault) GetAuthenticatedClient

func (s *AuthServiceDefault) GetAuthenticatedClient(ctx context.Context) (portalsdk.AccountAPI, error)

GetAuthenticatedClient returns an authenticated account client. If the stored token is an API key JWT, it uses LoginWithAPIKey to exchange it for a login JWT. If the stored token is a login JWT, it uses it directly.

func (*AuthServiceDefault) LoginCheck

func (s *AuthServiceDefault) LoginCheck(ctx context.Context, email, password string) (*portalsdk.LoginResult, error)

LoginCheck validates credentials and returns login result. This separates credential validation from authentication completion.

func (*AuthServiceDefault) LoginWithOTP

func (s *AuthServiceDefault) LoginWithOTP(ctx context.Context, intermediateJWT, otp, keyName string, noCreateKey bool) error

LoginWithOTP completes 2FA authentication using an intermediate JWT and OTP code.

func (*AuthServiceDefault) Register

func (s *AuthServiceDefault) Register(ctx context.Context, email, firstName, lastName, password string) error

Register creates a new user account.

func (*AuthServiceDefault) SaveToken

func (s *AuthServiceDefault) SaveToken(token string) error

SaveToken saves a JWT token to the config.

func (*AuthServiceDefault) Status

func (s *AuthServiceDefault) Status(ctx context.Context) error

Status checks if the current auth token is valid.

type AuthServiceFactory

type AuthServiceFactory func(cfgMgr config.Manager, output Output, apiEndpoint string) AuthService

AuthServiceFactory creates an auth service for testing.

type AuthServiceOption

type AuthServiceOption func(*AuthServiceDefault)

AuthServiceOption configures an AuthService.

func WithAuthAccountClient

func WithAuthAccountClient(client portalsdk.AccountAPI) AuthServiceOption

WithAuthAccountClient sets a custom account client for the auth service (useful for testing).

func WithClientFactory

func WithClientFactory(factory ClientFactory) AuthServiceOption

WithClientFactory sets a custom client factory for creating authenticated clients.

func WithPrompter

func WithPrompter(prompter AuthPrompter) AuthServiceOption

WithPrompter sets a custom auth prompter (useful for testing).

type AuthStep

type AuthStep struct{}

AuthStep handles authentication setup.

func (*AuthStep) Execute

func (s *AuthStep) Execute(ctx context.Context, wizard *SetupWizard) error

func (*AuthStep) Name

func (s *AuthStep) Name() string

func (*AuthStep) ShouldSkip

func (s *AuthStep) ShouldSkip(wizard *SetupWizard) bool

type AuthStepChoice

type AuthStepChoice int

AuthStepChoice represents user's choice for authentication step.

const (
	AuthChoiceCreateAccount AuthStepChoice = iota
	AuthChoiceSignIn
	AuthChoiceSkip
)

type BashCompletionDetector

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

BashCompletionDetector checks for bash completion configuration.

func (*BashCompletionDetector) ConfigPath

func (d *BashCompletionDetector) ConfigPath() string

func (*BashCompletionDetector) InstallCommand

func (d *BashCompletionDetector) InstallCommand() string

func (*BashCompletionDetector) IsConfigured

func (d *BashCompletionDetector) IsConfigured() (bool, error)

func (*BashCompletionDetector) Name

func (d *BashCompletionDetector) Name() string

type BatchOptions

type BatchOptions struct {
	Parallel   int
	ContinueOn bool
	Wait       bool
	Progress   bool
}

BatchOptions configures batch operations

type BatchProgressTracker

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

BatchProgressTracker tracks progress for batch operations.

func NewBatchProgressTracker

func NewBatchProgressTracker(total int, enabled bool, title string) *BatchProgressTracker

NewBatchProgressTracker creates a new batch progress tracker.

func (*BatchProgressTracker) Increment

func (bt *BatchProgressTracker) Increment()

Increment increments the completed count and updates progress.

func (*BatchProgressTracker) Start

func (bt *BatchProgressTracker) Start() error

Start begins displaying the progress bar.

func (*BatchProgressTracker) Stop

func (bt *BatchProgressTracker) Stop() error

Stop ensures the progress bar is stopped.

type BatchResult

type BatchResult struct {
	Total     int
	Succeeded []OperationResult
	Failed    []OperationError
	Skipped   []string
	Duration  time.Duration
}

BatchResult represents the result of a batch operation

type BillingAdminService

type BillingAdminService interface {
	RequireAuthenticated() error

	// Credit operations
	ListCredits(ctx context.Context, params *admin.GetApiBillingCreditsParams) ([]*admin.CreditItem, int, error)
	CreateCredit(ctx context.Context, req *admin.CreditCreateRequest) (*admin.Credit, error)
	GetCredit(ctx context.Context, creditID string) (*admin.Credit, error)
	DeleteCredit(ctx context.Context, creditID string) error
	RestoreCredit(ctx context.Context, creditID string) (*admin.Credit, error)
	PurgeCredits(ctx context.Context, req *admin.CreditPurgeRequest) (int, error)

	// User balance operations
	GetUserBalance(ctx context.Context, userID string) (*admin.UserBalance, error)
	GetUserDeletedCredits(ctx context.Context, userID string, params *admin.GetApiBillingUsersUserIdDeletedCreditsParams) ([]*admin.CreditItem, int, error)

	// Price line operations
	ListPriceLines(ctx context.Context) ([]*admin.PriceLine, int, error)
	CreatePriceLine(ctx context.Context, req *admin.PriceLineCreateRequest) (*admin.PriceLine, error)
	GetPriceLine(ctx context.Context, priceLineID string) (*admin.PriceLineDetailResponse, error)
	UpdatePriceLine(ctx context.Context, priceLineID string, req *admin.PriceLineUpdateRequest) (*admin.PriceLine, error)
	DeletePriceLine(ctx context.Context, priceLineID string) error

	// Pricing plan operations
	ListPricingPlans(ctx context.Context) ([]*admin.PricingPlanItem, int, error)
	GetPricingPlan(ctx context.Context, planID string) (*admin.PricingPlan, error)
	CreatePricingPlan(ctx context.Context, req *admin.PricingPlanCreateRequest) (*admin.PricingPlan, error)
	UpdatePricingPlan(ctx context.Context, planID string, req *admin.PricingPlanUpdateRequest) (*admin.PricingPlan, error)
	DeletePricingPlan(ctx context.Context, planID string) error

	// Pricing plan period operations
	ListPricingPlanPeriods(ctx context.Context) ([]*admin.PricingPlanPeriod, int, error)
	CreatePricingPlanPeriod(ctx context.Context, req *admin.PricingPlanPeriodCreateRequest) (*admin.PricingPlanPeriod, error)
	GetPricingPlanPeriod(ctx context.Context, periodID string) (*admin.PricingPlanPeriod, error)
	UpdatePricingPlanPeriod(ctx context.Context, periodID string, req *admin.PricingPlanPeriodUpdateRequest) (*admin.PricingPlanPeriod, error)
	DeletePricingPlanPeriod(ctx context.Context, periodID string) error

	// Subscriber operations
	ListSubscribers(ctx context.Context) ([]*admin.Subscriber, int, error)
	GetSubscriber(ctx context.Context, subscriberID string) (*admin.Subscriber, error)
	ListGatewaySubscribers(ctx context.Context, gatewayID string) ([]*admin.Subscriber, int, error)
	GetUserSubscribers(ctx context.Context, userID string) ([]*admin.Subscriber, int, error)

	// Subscription management operations
	CancelUserSubscription(ctx context.Context, userID string, req *admin.CancelSubscriptionRequest) (*admin.ManagementResult, error)
	AbortUserSubscriptionCancellation(ctx context.Context, userID string) (*admin.ManagementResult, error)
	ChangeUserPlan(ctx context.Context, userID string, req *admin.ChangePlanRequest) (*admin.PlanChangeResult, error)
	PauseUserSubscription(ctx context.Context, userID string) (*admin.ManagementResult, error)
	ResumeUserSubscription(ctx context.Context, userID string) (*admin.ManagementResult, error)

	// Price line plan operations
	AddPlanToPriceLine(ctx context.Context, priceLineID string, req *admin.AddPlanToPriceLineRequest) (*admin.PriceLineDetailResponse, error)
	DeletePlanFromPriceLine(ctx context.Context, priceLineID, planID string) error
	UpdatePlanPosition(ctx context.Context, priceLineID, planID string, req *admin.UpdatePlanPositionRequest) (*admin.PriceLineDetailResponse, error)

	// Sync operations
	SyncPricingPlan(ctx context.Context, planID string) error
	SyncAllPricingPlans(ctx context.Context) error
}

BillingAdminService defines the interface for billing admin operations.

func NewBillingAdminService

func NewBillingAdminService(cfgMgr config.Manager, output Output, apiEndpoint string) BillingAdminService

NewBillingAdminService creates a new BillingAdminService instance.

type BillingAdminServiceFactory

type BillingAdminServiceFactory func(cfgMgr config.Manager, output Output) BillingAdminService

BillingAdminServiceFactory creates a BillingAdminService with dependencies.

type ClientFactory

type ClientFactory func(endpoint, jwt string) portalsdk.AccountAPI

ClientFactory creates an account client with the given endpoint and JWT token.

type CompletionDetector

type CompletionDetector interface {
	// Name returns the shell name.
	Name() string

	// IsConfigured returns true if completion is configured for this shell.
	IsConfigured() (bool, error)

	// InstallCommand returns the command to install completion.
	InstallCommand() string

	// ConfigPath returns the path to the shell config file.
	ConfigPath() string
}

CompletionDetector defines the interface for checking shell completion configuration.

type CompletionDetectorFactory

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

CompletionDetectorFactory creates detectors for available shells.

func NewCompletionDetectorFactory

func NewCompletionDetectorFactory() (*CompletionDetectorFactory, error)

NewCompletionDetectorFactory creates a new detector factory.

func (*CompletionDetectorFactory) GetDetectors

func (f *CompletionDetectorFactory) GetDetectors() []CompletionDetector

GetDetectors returns all available completion detectors for the current OS.

type CompletionInfo

type CompletionInfo struct {
	Enabled    bool     `json:"enabled"`
	Shells     []string `json:"shells"`
	Configured []string `json:"configured"`
}

CompletionInfo contains shell completion status information

type CompletionStep

type CompletionStep struct{}

CompletionStep offers to enable shell completion.

func (*CompletionStep) Execute

func (s *CompletionStep) Execute(ctx context.Context, wizard *SetupWizard) error

func (*CompletionStep) Name

func (s *CompletionStep) Name() string

func (*CompletionStep) ShouldSkip

func (s *CompletionStep) ShouldSkip(wizard *SetupWizard) bool

type ConfigInfo

type ConfigInfo struct {
	Path     string `json:"path"`
	Exists   bool   `json:"exists"`
	Secure   bool   `json:"secure"`
	Endpoint string `json:"endpoint"`
}

ConfigInfo contains configuration-related diagnostic information

type ConfigManagerFactory

type ConfigManagerFactory func() (config.Manager, error)

ConfigManagerFactory creates a config manager for testing.

type ConfigStep

type ConfigStep struct{}

ConfigStep handles configuration setup.

func (*ConfigStep) Execute

func (s *ConfigStep) Execute(ctx context.Context, wizard *SetupWizard) error

func (*ConfigStep) Name

func (s *ConfigStep) Name() string

func (*ConfigStep) ShouldSkip

func (s *ConfigStep) ShouldSkip(wizard *SetupWizard) bool

type ConfigStepChoice

type ConfigStepChoice int

ConfigStepChoice represents user's choice for configuration step.

const (
	ConfigChoiceUseDefaults ConfigStepChoice = iota
	ConfigChoiceCustomEndpoint
	ConfigChoiceSkip
)

type Currency

type Currency struct {
	Amount float64
	Code   CurrencyCode // "USD", "EUR", etc.
}

Currency represents a monetary amount with a currency code.

func NewCurrency

func NewCurrency(amount float64, code CurrencyCode) Currency

NewCurrency creates a new Currency with the given amount and code.

func (Currency) String

func (c Currency) String() string

String formats the currency as "Amount Code" (e.g., "19.99 USD").

type CurrencyCode

type CurrencyCode string

CurrencyCode represents an ISO 4217 currency code.

const (
	USD CurrencyCode = "USD"
)

Currency constants for ISO 4217 codes.

type CustomConfig

type CustomConfig struct {
	Endpoint string
	Secure   bool
}

CustomConfig represents custom configuration values.

type DNSService

type DNSService interface {
	RequireAuthenticated() error

	// Zone operations
	CreateZone(ctx context.Context, domain string, nameservers []string) (*ipfs.ZoneResponse, error)
	ListZones(ctx context.Context) ([]ipfs.ZoneListResponse, error)
	GetZone(ctx context.Context, id string) (*ipfs.ZoneResponse, error)
	DeleteZone(ctx context.Context, id string) error

	// Record operations
	CreateRecord(ctx context.Context, id string, record ipfs.RecordRequest) (*ipfs.RecordResponse, error)
	ListRecords(ctx context.Context, id string) ([]ipfs.RecordResponse, error)
	GetRecord(ctx context.Context, id string, name string, recordType string) (*ipfs.RecordResponse, error)
	UpdateRecord(ctx context.Context, id string, name string, recordType string, record ipfs.RecordRequest) (*ipfs.RecordResponse, error)
	DeleteRecord(ctx context.Context, id string, name string, recordType string) error
}

DNSService defines the interface for DNS operations in the CLI.

func NewDNSService

func NewDNSService(cfgMgr config.Manager, output Output, apiEndpoint string) DNSService

NewDNSService creates a new DNSService instance with the provided configuration.

type DoctorReport

type DoctorReport struct {
	Version        string         `json:"version"`
	OS             string         `json:"os"`
	Arch           string         `json:"arch"`
	Config         ConfigInfo     `json:"config"`
	Limits         LimitsInfo     `json:"limits"`
	Authentication AuthInfo       `json:"authentication"`
	Completion     CompletionInfo `json:"completion"`
}

DoctorReport contains diagnostic information about the pinner CLI environment

type DryRunPreview

type DryRunPreview struct {
	Operation string
	Endpoint  string
	Items     []string
	ItemLabel string
	MaxItems  int
	Options   map[string]string
}

DryRunPreview represents a dry-run preview configuration.

type Field

type Field struct {
	Label string
	Value string
}

Field represents a labeled key-value pair for display.

type FieldGroup

type FieldGroup struct {
	Title  string
	Fields []Field
}

FieldGroup represents a titled collection of fields for structured display.

type FishCompletionDetector

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

FishCompletionDetector checks for fish completion configuration.

func (*FishCompletionDetector) ConfigPath

func (d *FishCompletionDetector) ConfigPath() string

func (*FishCompletionDetector) InstallCommand

func (d *FishCompletionDetector) InstallCommand() string

func (*FishCompletionDetector) IsConfigured

func (d *FishCompletionDetector) IsConfigured() (bool, error)

func (*FishCompletionDetector) Name

func (d *FishCompletionDetector) Name() string

type IPNSService

type IPNSService interface {
	// ListKeys retrieves all IPNS keys for the authenticated user.
	ListKeys(ctx context.Context) ([]ipfs.IPNSKeyResponse, error)

	// CreateKey generates a new IPNS key with the given name.
	CreateKey(ctx context.Context, name string, key *string) (*ipfs.IPNSKeyResponse, error)

	// GetKey retrieves a specific IPNS key by its ID.
	GetKey(ctx context.Context, id string) (*ipfs.IPNSKeyResponse, error)

	// DeleteKey removes an IPNS key by its ID.
	DeleteKey(ctx context.Context, id string) error

	// Publish publishes a CID to an IPNS key.
	Publish(ctx context.Context, cid string, keyId int, ttl *string) (*ipfs.IPNSPublishResponse, error)

	// Resolve resolves an IPNS name to its target CID.
	Resolve(ctx context.Context, name string) (*ipfs.IPNSResolveResponse, error)

	// RequireAuthenticated checks if the service is authenticated.
	RequireAuthenticated() error
}

IPNSService defines the interface for IPNS operations in the CLI layer.

func NewIPNSService

func NewIPNSService(cfgMgr config.Manager, output Output, apiEndpoint string) IPNSService

NewIPNSService creates a new IPNSService instance.

type IPNSServiceFactory

type IPNSServiceFactory func(cfgMgr config.Manager, output Output) IPNSService

IPNSServiceFactory creates an IPNSService with dependencies.

type LimitsInfo

type LimitsInfo struct {
	Memory     string `json:"memory"`
	MaxRetries int    `json:"maxRetries"`
}

LimitsInfo contains resource limits information

type ListGroup

type ListGroup struct {
	Title     string
	Fields    []Field
	Items     []string
	ItemLabel string
	MaxItems  int
	Footer    string
}

ListGroup represents a titled collection with fields and an optional item list.

type MockAuthPrompter

type MockAuthPrompter struct {
	mock.Mock
}

MockAuthPrompter is an autogenerated mock type for the AuthPrompter type

func NewMockAuthPrompter

func NewMockAuthPrompter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockAuthPrompter

NewMockAuthPrompter creates a new instance of MockAuthPrompter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockAuthPrompter) EXPECT

func (*MockAuthPrompter) Password

func (_mock *MockAuthPrompter) Password(label string) (string, error)

Password provides a mock function for the type MockAuthPrompter

func (*MockAuthPrompter) PromptEmail

func (_mock *MockAuthPrompter) PromptEmail() (string, error)

PromptEmail provides a mock function for the type MockAuthPrompter

func (*MockAuthPrompter) PromptOTP

func (_mock *MockAuthPrompter) PromptOTP() (string, error)

PromptOTP provides a mock function for the type MockAuthPrompter

func (*MockAuthPrompter) PromptPassword

func (_mock *MockAuthPrompter) PromptPassword() (string, error)

PromptPassword provides a mock function for the type MockAuthPrompter

func (*MockAuthPrompter) PromptString

func (_mock *MockAuthPrompter) PromptString(label string) (string, error)

PromptString provides a mock function for the type MockAuthPrompter

type MockAuthPrompter_Expecter

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

func (*MockAuthPrompter_Expecter) Password

func (_e *MockAuthPrompter_Expecter) Password(label interface{}) *MockAuthPrompter_Password_Call

Password is a helper method to define mock.On call

  • label string

func (*MockAuthPrompter_Expecter) PromptEmail

PromptEmail is a helper method to define mock.On call

func (*MockAuthPrompter_Expecter) PromptOTP

PromptOTP is a helper method to define mock.On call

func (*MockAuthPrompter_Expecter) PromptPassword

PromptPassword is a helper method to define mock.On call

func (*MockAuthPrompter_Expecter) PromptString

func (_e *MockAuthPrompter_Expecter) PromptString(label interface{}) *MockAuthPrompter_PromptString_Call

PromptString is a helper method to define mock.On call

  • label string

type MockAuthPrompter_Password_Call

type MockAuthPrompter_Password_Call struct {
	*mock.Call
}

MockAuthPrompter_Password_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Password'

func (*MockAuthPrompter_Password_Call) Return

func (*MockAuthPrompter_Password_Call) Run

func (*MockAuthPrompter_Password_Call) RunAndReturn

type MockAuthPrompter_PromptEmail_Call

type MockAuthPrompter_PromptEmail_Call struct {
	*mock.Call
}

MockAuthPrompter_PromptEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PromptEmail'

func (*MockAuthPrompter_PromptEmail_Call) Return

func (*MockAuthPrompter_PromptEmail_Call) Run

func (*MockAuthPrompter_PromptEmail_Call) RunAndReturn

type MockAuthPrompter_PromptOTP_Call

type MockAuthPrompter_PromptOTP_Call struct {
	*mock.Call
}

MockAuthPrompter_PromptOTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PromptOTP'

func (*MockAuthPrompter_PromptOTP_Call) Return

func (*MockAuthPrompter_PromptOTP_Call) Run

func (*MockAuthPrompter_PromptOTP_Call) RunAndReturn

type MockAuthPrompter_PromptPassword_Call

type MockAuthPrompter_PromptPassword_Call struct {
	*mock.Call
}

MockAuthPrompter_PromptPassword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PromptPassword'

func (*MockAuthPrompter_PromptPassword_Call) Return

func (*MockAuthPrompter_PromptPassword_Call) Run

func (*MockAuthPrompter_PromptPassword_Call) RunAndReturn

type MockAuthPrompter_PromptString_Call

type MockAuthPrompter_PromptString_Call struct {
	*mock.Call
}

MockAuthPrompter_PromptString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PromptString'

func (*MockAuthPrompter_PromptString_Call) Return

func (*MockAuthPrompter_PromptString_Call) Run

func (*MockAuthPrompter_PromptString_Call) RunAndReturn

type MockAuthService

type MockAuthService struct {
	mock.Mock
}

MockAuthService is an autogenerated mock type for the AuthService type

func NewMockAuthService

func NewMockAuthService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockAuthService

NewMockAuthService creates a new instance of MockAuthService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockAuthService) CompleteLogin

func (_mock *MockAuthService) CompleteLogin(ctx context.Context, token string, keyName string, noCreateKey bool) error

CompleteLogin provides a mock function for the type MockAuthService

func (*MockAuthService) DisableOTP

func (_mock *MockAuthService) DisableOTP(ctx context.Context, password string) error

DisableOTP provides a mock function for the type MockAuthService

func (*MockAuthService) EXPECT

func (*MockAuthService) EnableOTP

func (_mock *MockAuthService) EnableOTP(ctx context.Context, otpCode string) error

EnableOTP provides a mock function for the type MockAuthService

func (*MockAuthService) GetAPIEndpoint

func (_mock *MockAuthService) GetAPIEndpoint() string

GetAPIEndpoint provides a mock function for the type MockAuthService

func (*MockAuthService) GetAuthenticatedClient

func (_mock *MockAuthService) GetAuthenticatedClient(ctx context.Context) (account.AccountAPI, error)

GetAuthenticatedClient provides a mock function for the type MockAuthService

func (*MockAuthService) LoginCheck

func (_mock *MockAuthService) LoginCheck(ctx context.Context, email string, password string) (*account.LoginResult, error)

LoginCheck provides a mock function for the type MockAuthService

func (*MockAuthService) LoginWithOTP

func (_mock *MockAuthService) LoginWithOTP(ctx context.Context, intermediateJWT string, otp string, keyName string, noCreateKey bool) error

LoginWithOTP provides a mock function for the type MockAuthService

func (*MockAuthService) Register

func (_mock *MockAuthService) Register(ctx context.Context, email string, firstName string, lastName string, password string) error

Register provides a mock function for the type MockAuthService

func (*MockAuthService) SaveToken

func (_mock *MockAuthService) SaveToken(token string) error

SaveToken provides a mock function for the type MockAuthService

func (*MockAuthService) Status

func (_mock *MockAuthService) Status(ctx context.Context) error

Status provides a mock function for the type MockAuthService

type MockAuthService_CompleteLogin_Call

type MockAuthService_CompleteLogin_Call struct {
	*mock.Call
}

MockAuthService_CompleteLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompleteLogin'

func (*MockAuthService_CompleteLogin_Call) Return

func (*MockAuthService_CompleteLogin_Call) Run

func (_c *MockAuthService_CompleteLogin_Call) Run(run func(ctx context.Context, token string, keyName string, noCreateKey bool)) *MockAuthService_CompleteLogin_Call

func (*MockAuthService_CompleteLogin_Call) RunAndReturn

func (_c *MockAuthService_CompleteLogin_Call) RunAndReturn(run func(ctx context.Context, token string, keyName string, noCreateKey bool) error) *MockAuthService_CompleteLogin_Call

type MockAuthService_DisableOTP_Call

type MockAuthService_DisableOTP_Call struct {
	*mock.Call
}

MockAuthService_DisableOTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisableOTP'

func (*MockAuthService_DisableOTP_Call) Return

func (*MockAuthService_DisableOTP_Call) Run

func (*MockAuthService_DisableOTP_Call) RunAndReturn

type MockAuthService_EnableOTP_Call

type MockAuthService_EnableOTP_Call struct {
	*mock.Call
}

MockAuthService_EnableOTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableOTP'

func (*MockAuthService_EnableOTP_Call) Return

func (*MockAuthService_EnableOTP_Call) Run

func (*MockAuthService_EnableOTP_Call) RunAndReturn

type MockAuthService_Expecter

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

func (*MockAuthService_Expecter) CompleteLogin

func (_e *MockAuthService_Expecter) CompleteLogin(ctx interface{}, token interface{}, keyName interface{}, noCreateKey interface{}) *MockAuthService_CompleteLogin_Call

CompleteLogin is a helper method to define mock.On call

  • ctx context.Context
  • token string
  • keyName string
  • noCreateKey bool

func (*MockAuthService_Expecter) DisableOTP

func (_e *MockAuthService_Expecter) DisableOTP(ctx interface{}, password interface{}) *MockAuthService_DisableOTP_Call

DisableOTP is a helper method to define mock.On call

  • ctx context.Context
  • password string

func (*MockAuthService_Expecter) EnableOTP

func (_e *MockAuthService_Expecter) EnableOTP(ctx interface{}, otpCode interface{}) *MockAuthService_EnableOTP_Call

EnableOTP is a helper method to define mock.On call

  • ctx context.Context
  • otpCode string

func (*MockAuthService_Expecter) GetAPIEndpoint

GetAPIEndpoint is a helper method to define mock.On call

func (*MockAuthService_Expecter) GetAuthenticatedClient

func (_e *MockAuthService_Expecter) GetAuthenticatedClient(ctx interface{}) *MockAuthService_GetAuthenticatedClient_Call

GetAuthenticatedClient is a helper method to define mock.On call

  • ctx context.Context

func (*MockAuthService_Expecter) LoginCheck

func (_e *MockAuthService_Expecter) LoginCheck(ctx interface{}, email interface{}, password interface{}) *MockAuthService_LoginCheck_Call

LoginCheck is a helper method to define mock.On call

  • ctx context.Context
  • email string
  • password string

func (*MockAuthService_Expecter) LoginWithOTP

func (_e *MockAuthService_Expecter) LoginWithOTP(ctx interface{}, intermediateJWT interface{}, otp interface{}, keyName interface{}, noCreateKey interface{}) *MockAuthService_LoginWithOTP_Call

LoginWithOTP is a helper method to define mock.On call

  • ctx context.Context
  • intermediateJWT string
  • otp string
  • keyName string
  • noCreateKey bool

func (*MockAuthService_Expecter) Register

func (_e *MockAuthService_Expecter) Register(ctx interface{}, email interface{}, firstName interface{}, lastName interface{}, password interface{}) *MockAuthService_Register_Call

Register is a helper method to define mock.On call

  • ctx context.Context
  • email string
  • firstName string
  • lastName string
  • password string

func (*MockAuthService_Expecter) SaveToken

func (_e *MockAuthService_Expecter) SaveToken(token interface{}) *MockAuthService_SaveToken_Call

SaveToken is a helper method to define mock.On call

  • token string

func (*MockAuthService_Expecter) Status

func (_e *MockAuthService_Expecter) Status(ctx interface{}) *MockAuthService_Status_Call

Status is a helper method to define mock.On call

  • ctx context.Context

type MockAuthService_GetAPIEndpoint_Call

type MockAuthService_GetAPIEndpoint_Call struct {
	*mock.Call
}

MockAuthService_GetAPIEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAPIEndpoint'

func (*MockAuthService_GetAPIEndpoint_Call) Return

func (*MockAuthService_GetAPIEndpoint_Call) Run

func (*MockAuthService_GetAPIEndpoint_Call) RunAndReturn

type MockAuthService_GetAuthenticatedClient_Call

type MockAuthService_GetAuthenticatedClient_Call struct {
	*mock.Call
}

MockAuthService_GetAuthenticatedClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAuthenticatedClient'

func (*MockAuthService_GetAuthenticatedClient_Call) Return

func (*MockAuthService_GetAuthenticatedClient_Call) Run

func (*MockAuthService_GetAuthenticatedClient_Call) RunAndReturn

type MockAuthService_LoginCheck_Call

type MockAuthService_LoginCheck_Call struct {
	*mock.Call
}

MockAuthService_LoginCheck_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoginCheck'

func (*MockAuthService_LoginCheck_Call) Return

func (_c *MockAuthService_LoginCheck_Call) Return(loginResult *account.LoginResult, err error) *MockAuthService_LoginCheck_Call

func (*MockAuthService_LoginCheck_Call) Run

func (*MockAuthService_LoginCheck_Call) RunAndReturn

func (_c *MockAuthService_LoginCheck_Call) RunAndReturn(run func(ctx context.Context, email string, password string) (*account.LoginResult, error)) *MockAuthService_LoginCheck_Call

type MockAuthService_LoginWithOTP_Call

type MockAuthService_LoginWithOTP_Call struct {
	*mock.Call
}

MockAuthService_LoginWithOTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoginWithOTP'

func (*MockAuthService_LoginWithOTP_Call) Return

func (*MockAuthService_LoginWithOTP_Call) Run

func (_c *MockAuthService_LoginWithOTP_Call) Run(run func(ctx context.Context, intermediateJWT string, otp string, keyName string, noCreateKey bool)) *MockAuthService_LoginWithOTP_Call

func (*MockAuthService_LoginWithOTP_Call) RunAndReturn

func (_c *MockAuthService_LoginWithOTP_Call) RunAndReturn(run func(ctx context.Context, intermediateJWT string, otp string, keyName string, noCreateKey bool) error) *MockAuthService_LoginWithOTP_Call

type MockAuthService_Register_Call

type MockAuthService_Register_Call struct {
	*mock.Call
}

MockAuthService_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register'

func (*MockAuthService_Register_Call) Return

func (*MockAuthService_Register_Call) Run

func (_c *MockAuthService_Register_Call) Run(run func(ctx context.Context, email string, firstName string, lastName string, password string)) *MockAuthService_Register_Call

func (*MockAuthService_Register_Call) RunAndReturn

func (_c *MockAuthService_Register_Call) RunAndReturn(run func(ctx context.Context, email string, firstName string, lastName string, password string) error) *MockAuthService_Register_Call

type MockAuthService_SaveToken_Call

type MockAuthService_SaveToken_Call struct {
	*mock.Call
}

MockAuthService_SaveToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveToken'

func (*MockAuthService_SaveToken_Call) Return

func (*MockAuthService_SaveToken_Call) Run

func (*MockAuthService_SaveToken_Call) RunAndReturn

type MockAuthService_Status_Call

type MockAuthService_Status_Call struct {
	*mock.Call
}

MockAuthService_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status'

func (*MockAuthService_Status_Call) Return

func (*MockAuthService_Status_Call) Run

func (*MockAuthService_Status_Call) RunAndReturn

type MockBillingAdminService

type MockBillingAdminService struct {
	mock.Mock
}

MockBillingAdminService is an autogenerated mock type for the BillingAdminService type

func NewMockBillingAdminService

func NewMockBillingAdminService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockBillingAdminService

NewMockBillingAdminService creates a new instance of MockBillingAdminService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockBillingAdminService) AbortUserSubscriptionCancellation

func (_mock *MockBillingAdminService) AbortUserSubscriptionCancellation(ctx context.Context, userID string) (*admin.ManagementResult, error)

AbortUserSubscriptionCancellation provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) AddPlanToPriceLine

func (_mock *MockBillingAdminService) AddPlanToPriceLine(ctx context.Context, priceLineID string, req *admin.AddPlanToPriceLineRequest) (*admin.PriceLineDetailResponse, error)

AddPlanToPriceLine provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) CancelUserSubscription

func (_mock *MockBillingAdminService) CancelUserSubscription(ctx context.Context, userID string, req *admin.CancelSubscriptionRequest) (*admin.ManagementResult, error)

CancelUserSubscription provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) ChangeUserPlan

func (_mock *MockBillingAdminService) ChangeUserPlan(ctx context.Context, userID string, req *admin.ChangePlanRequest) (*admin.PlanChangeResult, error)

ChangeUserPlan provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) CreateCredit

CreateCredit provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) CreatePriceLine

CreatePriceLine provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) CreatePricingPlan

CreatePricingPlan provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) CreatePricingPlanPeriod

CreatePricingPlanPeriod provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) DeleteCredit

func (_mock *MockBillingAdminService) DeleteCredit(ctx context.Context, creditID string) error

DeleteCredit provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) DeletePlanFromPriceLine

func (_mock *MockBillingAdminService) DeletePlanFromPriceLine(ctx context.Context, priceLineID string, planID string) error

DeletePlanFromPriceLine provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) DeletePriceLine

func (_mock *MockBillingAdminService) DeletePriceLine(ctx context.Context, priceLineID string) error

DeletePriceLine provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) DeletePricingPlan

func (_mock *MockBillingAdminService) DeletePricingPlan(ctx context.Context, planID string) error

DeletePricingPlan provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) DeletePricingPlanPeriod

func (_mock *MockBillingAdminService) DeletePricingPlanPeriod(ctx context.Context, periodID string) error

DeletePricingPlanPeriod provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) EXPECT

func (*MockBillingAdminService) GetCredit

func (_mock *MockBillingAdminService) GetCredit(ctx context.Context, creditID string) (*admin.Credit, error)

GetCredit provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) GetPriceLine

func (_mock *MockBillingAdminService) GetPriceLine(ctx context.Context, priceLineID string) (*admin.PriceLineDetailResponse, error)

GetPriceLine provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) GetPricingPlan

func (_mock *MockBillingAdminService) GetPricingPlan(ctx context.Context, planID string) (*admin.PricingPlan, error)

GetPricingPlan provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) GetPricingPlanPeriod

func (_mock *MockBillingAdminService) GetPricingPlanPeriod(ctx context.Context, periodID string) (*admin.PricingPlanPeriod, error)

GetPricingPlanPeriod provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) GetSubscriber

func (_mock *MockBillingAdminService) GetSubscriber(ctx context.Context, subscriberID string) (*admin.Subscriber, error)

GetSubscriber provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) GetUserBalance

func (_mock *MockBillingAdminService) GetUserBalance(ctx context.Context, userID string) (*admin.UserBalance, error)

GetUserBalance provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) GetUserDeletedCredits

GetUserDeletedCredits provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) GetUserSubscribers

func (_mock *MockBillingAdminService) GetUserSubscribers(ctx context.Context, userID string) ([]*admin.Subscriber, int, error)

GetUserSubscribers provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) ListCredits

ListCredits provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) ListGatewaySubscribers

func (_mock *MockBillingAdminService) ListGatewaySubscribers(ctx context.Context, gatewayID string) ([]*admin.Subscriber, int, error)

ListGatewaySubscribers provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) ListPriceLines

func (_mock *MockBillingAdminService) ListPriceLines(ctx context.Context) ([]*admin.PriceLine, int, error)

ListPriceLines provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) ListPricingPlanPeriods

func (_mock *MockBillingAdminService) ListPricingPlanPeriods(ctx context.Context) ([]*admin.PricingPlanPeriod, int, error)

ListPricingPlanPeriods provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) ListPricingPlans

func (_mock *MockBillingAdminService) ListPricingPlans(ctx context.Context) ([]*admin.PricingPlanItem, int, error)

ListPricingPlans provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) ListSubscribers

func (_mock *MockBillingAdminService) ListSubscribers(ctx context.Context) ([]*admin.Subscriber, int, error)

ListSubscribers provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) PauseUserSubscription

func (_mock *MockBillingAdminService) PauseUserSubscription(ctx context.Context, userID string) (*admin.ManagementResult, error)

PauseUserSubscription provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) PurgeCredits

func (_mock *MockBillingAdminService) PurgeCredits(ctx context.Context, req *admin.CreditPurgeRequest) (int, error)

PurgeCredits provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) RequireAuthenticated

func (_mock *MockBillingAdminService) RequireAuthenticated() error

RequireAuthenticated provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) RestoreCredit

func (_mock *MockBillingAdminService) RestoreCredit(ctx context.Context, creditID string) (*admin.Credit, error)

RestoreCredit provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) ResumeUserSubscription

func (_mock *MockBillingAdminService) ResumeUserSubscription(ctx context.Context, userID string) (*admin.ManagementResult, error)

ResumeUserSubscription provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) SyncAllPricingPlans

func (_mock *MockBillingAdminService) SyncAllPricingPlans(ctx context.Context) error

SyncAllPricingPlans provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) SyncPricingPlan

func (_mock *MockBillingAdminService) SyncPricingPlan(ctx context.Context, planID string) error

SyncPricingPlan provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) UpdatePlanPosition

func (_mock *MockBillingAdminService) UpdatePlanPosition(ctx context.Context, priceLineID string, planID string, req *admin.UpdatePlanPositionRequest) (*admin.PriceLineDetailResponse, error)

UpdatePlanPosition provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) UpdatePriceLine

func (_mock *MockBillingAdminService) UpdatePriceLine(ctx context.Context, priceLineID string, req *admin.PriceLineUpdateRequest) (*admin.PriceLine, error)

UpdatePriceLine provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) UpdatePricingPlan

func (_mock *MockBillingAdminService) UpdatePricingPlan(ctx context.Context, planID string, req *admin.PricingPlanUpdateRequest) (*admin.PricingPlan, error)

UpdatePricingPlan provides a mock function for the type MockBillingAdminService

func (*MockBillingAdminService) UpdatePricingPlanPeriod

func (_mock *MockBillingAdminService) UpdatePricingPlanPeriod(ctx context.Context, periodID string, req *admin.PricingPlanPeriodUpdateRequest) (*admin.PricingPlanPeriod, error)

UpdatePricingPlanPeriod provides a mock function for the type MockBillingAdminService

type MockBillingAdminService_AbortUserSubscriptionCancellation_Call

type MockBillingAdminService_AbortUserSubscriptionCancellation_Call struct {
	*mock.Call
}

MockBillingAdminService_AbortUserSubscriptionCancellation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortUserSubscriptionCancellation'

func (*MockBillingAdminService_AbortUserSubscriptionCancellation_Call) Return

func (*MockBillingAdminService_AbortUserSubscriptionCancellation_Call) Run

func (*MockBillingAdminService_AbortUserSubscriptionCancellation_Call) RunAndReturn

type MockBillingAdminService_AddPlanToPriceLine_Call

type MockBillingAdminService_AddPlanToPriceLine_Call struct {
	*mock.Call
}

MockBillingAdminService_AddPlanToPriceLine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPlanToPriceLine'

func (*MockBillingAdminService_AddPlanToPriceLine_Call) Return

func (*MockBillingAdminService_AddPlanToPriceLine_Call) Run

func (*MockBillingAdminService_AddPlanToPriceLine_Call) RunAndReturn

type MockBillingAdminService_CancelUserSubscription_Call

type MockBillingAdminService_CancelUserSubscription_Call struct {
	*mock.Call
}

MockBillingAdminService_CancelUserSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelUserSubscription'

func (*MockBillingAdminService_CancelUserSubscription_Call) Return

func (*MockBillingAdminService_CancelUserSubscription_Call) Run

func (*MockBillingAdminService_CancelUserSubscription_Call) RunAndReturn

type MockBillingAdminService_ChangeUserPlan_Call

type MockBillingAdminService_ChangeUserPlan_Call struct {
	*mock.Call
}

MockBillingAdminService_ChangeUserPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChangeUserPlan'

func (*MockBillingAdminService_ChangeUserPlan_Call) Return

func (*MockBillingAdminService_ChangeUserPlan_Call) Run

func (*MockBillingAdminService_ChangeUserPlan_Call) RunAndReturn

type MockBillingAdminService_CreateCredit_Call

type MockBillingAdminService_CreateCredit_Call struct {
	*mock.Call
}

MockBillingAdminService_CreateCredit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateCredit'

func (*MockBillingAdminService_CreateCredit_Call) Return

func (*MockBillingAdminService_CreateCredit_Call) Run

func (*MockBillingAdminService_CreateCredit_Call) RunAndReturn

type MockBillingAdminService_CreatePriceLine_Call

type MockBillingAdminService_CreatePriceLine_Call struct {
	*mock.Call
}

MockBillingAdminService_CreatePriceLine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatePriceLine'

func (*MockBillingAdminService_CreatePriceLine_Call) Return

func (*MockBillingAdminService_CreatePriceLine_Call) Run

func (*MockBillingAdminService_CreatePriceLine_Call) RunAndReturn

type MockBillingAdminService_CreatePricingPlanPeriod_Call

type MockBillingAdminService_CreatePricingPlanPeriod_Call struct {
	*mock.Call
}

MockBillingAdminService_CreatePricingPlanPeriod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatePricingPlanPeriod'

func (*MockBillingAdminService_CreatePricingPlanPeriod_Call) Return

func (*MockBillingAdminService_CreatePricingPlanPeriod_Call) Run

type MockBillingAdminService_CreatePricingPlan_Call

type MockBillingAdminService_CreatePricingPlan_Call struct {
	*mock.Call
}

MockBillingAdminService_CreatePricingPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatePricingPlan'

func (*MockBillingAdminService_CreatePricingPlan_Call) Return

func (*MockBillingAdminService_CreatePricingPlan_Call) Run

func (*MockBillingAdminService_CreatePricingPlan_Call) RunAndReturn

type MockBillingAdminService_DeleteCredit_Call

type MockBillingAdminService_DeleteCredit_Call struct {
	*mock.Call
}

MockBillingAdminService_DeleteCredit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteCredit'

func (*MockBillingAdminService_DeleteCredit_Call) Return

func (*MockBillingAdminService_DeleteCredit_Call) Run

func (*MockBillingAdminService_DeleteCredit_Call) RunAndReturn

type MockBillingAdminService_DeletePlanFromPriceLine_Call

type MockBillingAdminService_DeletePlanFromPriceLine_Call struct {
	*mock.Call
}

MockBillingAdminService_DeletePlanFromPriceLine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePlanFromPriceLine'

func (*MockBillingAdminService_DeletePlanFromPriceLine_Call) Return

func (*MockBillingAdminService_DeletePlanFromPriceLine_Call) Run

func (*MockBillingAdminService_DeletePlanFromPriceLine_Call) RunAndReturn

type MockBillingAdminService_DeletePriceLine_Call

type MockBillingAdminService_DeletePriceLine_Call struct {
	*mock.Call
}

MockBillingAdminService_DeletePriceLine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePriceLine'

func (*MockBillingAdminService_DeletePriceLine_Call) Return

func (*MockBillingAdminService_DeletePriceLine_Call) Run

func (*MockBillingAdminService_DeletePriceLine_Call) RunAndReturn

type MockBillingAdminService_DeletePricingPlanPeriod_Call

type MockBillingAdminService_DeletePricingPlanPeriod_Call struct {
	*mock.Call
}

MockBillingAdminService_DeletePricingPlanPeriod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePricingPlanPeriod'

func (*MockBillingAdminService_DeletePricingPlanPeriod_Call) Return

func (*MockBillingAdminService_DeletePricingPlanPeriod_Call) Run

func (*MockBillingAdminService_DeletePricingPlanPeriod_Call) RunAndReturn

type MockBillingAdminService_DeletePricingPlan_Call

type MockBillingAdminService_DeletePricingPlan_Call struct {
	*mock.Call
}

MockBillingAdminService_DeletePricingPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePricingPlan'

func (*MockBillingAdminService_DeletePricingPlan_Call) Return

func (*MockBillingAdminService_DeletePricingPlan_Call) Run

func (*MockBillingAdminService_DeletePricingPlan_Call) RunAndReturn

type MockBillingAdminService_Expecter

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

func (*MockBillingAdminService_Expecter) AbortUserSubscriptionCancellation

func (_e *MockBillingAdminService_Expecter) AbortUserSubscriptionCancellation(ctx interface{}, userID interface{}) *MockBillingAdminService_AbortUserSubscriptionCancellation_Call

AbortUserSubscriptionCancellation is a helper method to define mock.On call

  • ctx context.Context
  • userID string

func (*MockBillingAdminService_Expecter) AddPlanToPriceLine

func (_e *MockBillingAdminService_Expecter) AddPlanToPriceLine(ctx interface{}, priceLineID interface{}, req interface{}) *MockBillingAdminService_AddPlanToPriceLine_Call

AddPlanToPriceLine is a helper method to define mock.On call

  • ctx context.Context
  • priceLineID string
  • req *admin.AddPlanToPriceLineRequest

func (*MockBillingAdminService_Expecter) CancelUserSubscription

func (_e *MockBillingAdminService_Expecter) CancelUserSubscription(ctx interface{}, userID interface{}, req interface{}) *MockBillingAdminService_CancelUserSubscription_Call

CancelUserSubscription is a helper method to define mock.On call

  • ctx context.Context
  • userID string
  • req *admin.CancelSubscriptionRequest

func (*MockBillingAdminService_Expecter) ChangeUserPlan

func (_e *MockBillingAdminService_Expecter) ChangeUserPlan(ctx interface{}, userID interface{}, req interface{}) *MockBillingAdminService_ChangeUserPlan_Call

ChangeUserPlan is a helper method to define mock.On call

  • ctx context.Context
  • userID string
  • req *admin.ChangePlanRequest

func (*MockBillingAdminService_Expecter) CreateCredit

func (_e *MockBillingAdminService_Expecter) CreateCredit(ctx interface{}, req interface{}) *MockBillingAdminService_CreateCredit_Call

CreateCredit is a helper method to define mock.On call

  • ctx context.Context
  • req *admin.CreditCreateRequest

func (*MockBillingAdminService_Expecter) CreatePriceLine

func (_e *MockBillingAdminService_Expecter) CreatePriceLine(ctx interface{}, req interface{}) *MockBillingAdminService_CreatePriceLine_Call

CreatePriceLine is a helper method to define mock.On call

  • ctx context.Context
  • req *admin.PriceLineCreateRequest

func (*MockBillingAdminService_Expecter) CreatePricingPlan

func (_e *MockBillingAdminService_Expecter) CreatePricingPlan(ctx interface{}, req interface{}) *MockBillingAdminService_CreatePricingPlan_Call

CreatePricingPlan is a helper method to define mock.On call

  • ctx context.Context
  • req *admin.PricingPlanCreateRequest

func (*MockBillingAdminService_Expecter) CreatePricingPlanPeriod

func (_e *MockBillingAdminService_Expecter) CreatePricingPlanPeriod(ctx interface{}, req interface{}) *MockBillingAdminService_CreatePricingPlanPeriod_Call

CreatePricingPlanPeriod is a helper method to define mock.On call

  • ctx context.Context
  • req *admin.PricingPlanPeriodCreateRequest

func (*MockBillingAdminService_Expecter) DeleteCredit

func (_e *MockBillingAdminService_Expecter) DeleteCredit(ctx interface{}, creditID interface{}) *MockBillingAdminService_DeleteCredit_Call

DeleteCredit is a helper method to define mock.On call

  • ctx context.Context
  • creditID string

func (*MockBillingAdminService_Expecter) DeletePlanFromPriceLine

func (_e *MockBillingAdminService_Expecter) DeletePlanFromPriceLine(ctx interface{}, priceLineID interface{}, planID interface{}) *MockBillingAdminService_DeletePlanFromPriceLine_Call

DeletePlanFromPriceLine is a helper method to define mock.On call

  • ctx context.Context
  • priceLineID string
  • planID string

func (*MockBillingAdminService_Expecter) DeletePriceLine

func (_e *MockBillingAdminService_Expecter) DeletePriceLine(ctx interface{}, priceLineID interface{}) *MockBillingAdminService_DeletePriceLine_Call

DeletePriceLine is a helper method to define mock.On call

  • ctx context.Context
  • priceLineID string

func (*MockBillingAdminService_Expecter) DeletePricingPlan

func (_e *MockBillingAdminService_Expecter) DeletePricingPlan(ctx interface{}, planID interface{}) *MockBillingAdminService_DeletePricingPlan_Call

DeletePricingPlan is a helper method to define mock.On call

  • ctx context.Context
  • planID string

func (*MockBillingAdminService_Expecter) DeletePricingPlanPeriod

func (_e *MockBillingAdminService_Expecter) DeletePricingPlanPeriod(ctx interface{}, periodID interface{}) *MockBillingAdminService_DeletePricingPlanPeriod_Call

DeletePricingPlanPeriod is a helper method to define mock.On call

  • ctx context.Context
  • periodID string

func (*MockBillingAdminService_Expecter) GetCredit

func (_e *MockBillingAdminService_Expecter) GetCredit(ctx interface{}, creditID interface{}) *MockBillingAdminService_GetCredit_Call

GetCredit is a helper method to define mock.On call

  • ctx context.Context
  • creditID string

func (*MockBillingAdminService_Expecter) GetPriceLine

func (_e *MockBillingAdminService_Expecter) GetPriceLine(ctx interface{}, priceLineID interface{}) *MockBillingAdminService_GetPriceLine_Call

GetPriceLine is a helper method to define mock.On call

  • ctx context.Context
  • priceLineID string

func (*MockBillingAdminService_Expecter) GetPricingPlan

func (_e *MockBillingAdminService_Expecter) GetPricingPlan(ctx interface{}, planID interface{}) *MockBillingAdminService_GetPricingPlan_Call

GetPricingPlan is a helper method to define mock.On call

  • ctx context.Context
  • planID string

func (*MockBillingAdminService_Expecter) GetPricingPlanPeriod

func (_e *MockBillingAdminService_Expecter) GetPricingPlanPeriod(ctx interface{}, periodID interface{}) *MockBillingAdminService_GetPricingPlanPeriod_Call

GetPricingPlanPeriod is a helper method to define mock.On call

  • ctx context.Context
  • periodID string

func (*MockBillingAdminService_Expecter) GetSubscriber

func (_e *MockBillingAdminService_Expecter) GetSubscriber(ctx interface{}, subscriberID interface{}) *MockBillingAdminService_GetSubscriber_Call

GetSubscriber is a helper method to define mock.On call

  • ctx context.Context
  • subscriberID string

func (*MockBillingAdminService_Expecter) GetUserBalance

func (_e *MockBillingAdminService_Expecter) GetUserBalance(ctx interface{}, userID interface{}) *MockBillingAdminService_GetUserBalance_Call

GetUserBalance is a helper method to define mock.On call

  • ctx context.Context
  • userID string

func (*MockBillingAdminService_Expecter) GetUserDeletedCredits

func (_e *MockBillingAdminService_Expecter) GetUserDeletedCredits(ctx interface{}, userID interface{}, params interface{}) *MockBillingAdminService_GetUserDeletedCredits_Call

GetUserDeletedCredits is a helper method to define mock.On call

  • ctx context.Context
  • userID string
  • params *admin.GetApiBillingUsersUserIdDeletedCreditsParams

func (*MockBillingAdminService_Expecter) GetUserSubscribers

func (_e *MockBillingAdminService_Expecter) GetUserSubscribers(ctx interface{}, userID interface{}) *MockBillingAdminService_GetUserSubscribers_Call

GetUserSubscribers is a helper method to define mock.On call

  • ctx context.Context
  • userID string

func (*MockBillingAdminService_Expecter) ListCredits

func (_e *MockBillingAdminService_Expecter) ListCredits(ctx interface{}, params interface{}) *MockBillingAdminService_ListCredits_Call

ListCredits is a helper method to define mock.On call

  • ctx context.Context
  • params *admin.GetApiBillingCreditsParams

func (*MockBillingAdminService_Expecter) ListGatewaySubscribers

func (_e *MockBillingAdminService_Expecter) ListGatewaySubscribers(ctx interface{}, gatewayID interface{}) *MockBillingAdminService_ListGatewaySubscribers_Call

ListGatewaySubscribers is a helper method to define mock.On call

  • ctx context.Context
  • gatewayID string

func (*MockBillingAdminService_Expecter) ListPriceLines

ListPriceLines is a helper method to define mock.On call

  • ctx context.Context

func (*MockBillingAdminService_Expecter) ListPricingPlanPeriods

ListPricingPlanPeriods is a helper method to define mock.On call

  • ctx context.Context

func (*MockBillingAdminService_Expecter) ListPricingPlans

ListPricingPlans is a helper method to define mock.On call

  • ctx context.Context

func (*MockBillingAdminService_Expecter) ListSubscribers

ListSubscribers is a helper method to define mock.On call

  • ctx context.Context

func (*MockBillingAdminService_Expecter) PauseUserSubscription

func (_e *MockBillingAdminService_Expecter) PauseUserSubscription(ctx interface{}, userID interface{}) *MockBillingAdminService_PauseUserSubscription_Call

PauseUserSubscription is a helper method to define mock.On call

  • ctx context.Context
  • userID string

func (*MockBillingAdminService_Expecter) PurgeCredits

func (_e *MockBillingAdminService_Expecter) PurgeCredits(ctx interface{}, req interface{}) *MockBillingAdminService_PurgeCredits_Call

PurgeCredits is a helper method to define mock.On call

  • ctx context.Context
  • req *admin.CreditPurgeRequest

func (*MockBillingAdminService_Expecter) RequireAuthenticated

RequireAuthenticated is a helper method to define mock.On call

func (*MockBillingAdminService_Expecter) RestoreCredit

func (_e *MockBillingAdminService_Expecter) RestoreCredit(ctx interface{}, creditID interface{}) *MockBillingAdminService_RestoreCredit_Call

RestoreCredit is a helper method to define mock.On call

  • ctx context.Context
  • creditID string

func (*MockBillingAdminService_Expecter) ResumeUserSubscription

func (_e *MockBillingAdminService_Expecter) ResumeUserSubscription(ctx interface{}, userID interface{}) *MockBillingAdminService_ResumeUserSubscription_Call

ResumeUserSubscription is a helper method to define mock.On call

  • ctx context.Context
  • userID string

func (*MockBillingAdminService_Expecter) SyncAllPricingPlans

SyncAllPricingPlans is a helper method to define mock.On call

  • ctx context.Context

func (*MockBillingAdminService_Expecter) SyncPricingPlan

func (_e *MockBillingAdminService_Expecter) SyncPricingPlan(ctx interface{}, planID interface{}) *MockBillingAdminService_SyncPricingPlan_Call

SyncPricingPlan is a helper method to define mock.On call

  • ctx context.Context
  • planID string

func (*MockBillingAdminService_Expecter) UpdatePlanPosition

func (_e *MockBillingAdminService_Expecter) UpdatePlanPosition(ctx interface{}, priceLineID interface{}, planID interface{}, req interface{}) *MockBillingAdminService_UpdatePlanPosition_Call

UpdatePlanPosition is a helper method to define mock.On call

  • ctx context.Context
  • priceLineID string
  • planID string
  • req *admin.UpdatePlanPositionRequest

func (*MockBillingAdminService_Expecter) UpdatePriceLine

func (_e *MockBillingAdminService_Expecter) UpdatePriceLine(ctx interface{}, priceLineID interface{}, req interface{}) *MockBillingAdminService_UpdatePriceLine_Call

UpdatePriceLine is a helper method to define mock.On call

  • ctx context.Context
  • priceLineID string
  • req *admin.PriceLineUpdateRequest

func (*MockBillingAdminService_Expecter) UpdatePricingPlan

func (_e *MockBillingAdminService_Expecter) UpdatePricingPlan(ctx interface{}, planID interface{}, req interface{}) *MockBillingAdminService_UpdatePricingPlan_Call

UpdatePricingPlan is a helper method to define mock.On call

  • ctx context.Context
  • planID string
  • req *admin.PricingPlanUpdateRequest

func (*MockBillingAdminService_Expecter) UpdatePricingPlanPeriod

func (_e *MockBillingAdminService_Expecter) UpdatePricingPlanPeriod(ctx interface{}, periodID interface{}, req interface{}) *MockBillingAdminService_UpdatePricingPlanPeriod_Call

UpdatePricingPlanPeriod is a helper method to define mock.On call

  • ctx context.Context
  • periodID string
  • req *admin.PricingPlanPeriodUpdateRequest

type MockBillingAdminService_GetCredit_Call

type MockBillingAdminService_GetCredit_Call struct {
	*mock.Call
}

MockBillingAdminService_GetCredit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCredit'

func (*MockBillingAdminService_GetCredit_Call) Return

func (*MockBillingAdminService_GetCredit_Call) Run

func (*MockBillingAdminService_GetCredit_Call) RunAndReturn

type MockBillingAdminService_GetPriceLine_Call

type MockBillingAdminService_GetPriceLine_Call struct {
	*mock.Call
}

MockBillingAdminService_GetPriceLine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPriceLine'

func (*MockBillingAdminService_GetPriceLine_Call) Return

func (*MockBillingAdminService_GetPriceLine_Call) Run

func (*MockBillingAdminService_GetPriceLine_Call) RunAndReturn

type MockBillingAdminService_GetPricingPlanPeriod_Call

type MockBillingAdminService_GetPricingPlanPeriod_Call struct {
	*mock.Call
}

MockBillingAdminService_GetPricingPlanPeriod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPricingPlanPeriod'

func (*MockBillingAdminService_GetPricingPlanPeriod_Call) Return

func (*MockBillingAdminService_GetPricingPlanPeriod_Call) Run

func (*MockBillingAdminService_GetPricingPlanPeriod_Call) RunAndReturn

type MockBillingAdminService_GetPricingPlan_Call

type MockBillingAdminService_GetPricingPlan_Call struct {
	*mock.Call
}

MockBillingAdminService_GetPricingPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPricingPlan'

func (*MockBillingAdminService_GetPricingPlan_Call) Return

func (*MockBillingAdminService_GetPricingPlan_Call) Run

func (*MockBillingAdminService_GetPricingPlan_Call) RunAndReturn

type MockBillingAdminService_GetSubscriber_Call

type MockBillingAdminService_GetSubscriber_Call struct {
	*mock.Call
}

MockBillingAdminService_GetSubscriber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubscriber'

func (*MockBillingAdminService_GetSubscriber_Call) Return

func (*MockBillingAdminService_GetSubscriber_Call) Run

func (*MockBillingAdminService_GetSubscriber_Call) RunAndReturn

type MockBillingAdminService_GetUserBalance_Call

type MockBillingAdminService_GetUserBalance_Call struct {
	*mock.Call
}

MockBillingAdminService_GetUserBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserBalance'

func (*MockBillingAdminService_GetUserBalance_Call) Return

func (*MockBillingAdminService_GetUserBalance_Call) Run

func (*MockBillingAdminService_GetUserBalance_Call) RunAndReturn

type MockBillingAdminService_GetUserDeletedCredits_Call

type MockBillingAdminService_GetUserDeletedCredits_Call struct {
	*mock.Call
}

MockBillingAdminService_GetUserDeletedCredits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserDeletedCredits'

func (*MockBillingAdminService_GetUserDeletedCredits_Call) Return

func (*MockBillingAdminService_GetUserDeletedCredits_Call) Run

type MockBillingAdminService_GetUserSubscribers_Call

type MockBillingAdminService_GetUserSubscribers_Call struct {
	*mock.Call
}

MockBillingAdminService_GetUserSubscribers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserSubscribers'

func (*MockBillingAdminService_GetUserSubscribers_Call) Return

func (*MockBillingAdminService_GetUserSubscribers_Call) Run

func (*MockBillingAdminService_GetUserSubscribers_Call) RunAndReturn

type MockBillingAdminService_ListCredits_Call

type MockBillingAdminService_ListCredits_Call struct {
	*mock.Call
}

MockBillingAdminService_ListCredits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListCredits'

func (*MockBillingAdminService_ListCredits_Call) Return

func (*MockBillingAdminService_ListCredits_Call) Run

func (*MockBillingAdminService_ListCredits_Call) RunAndReturn

type MockBillingAdminService_ListGatewaySubscribers_Call

type MockBillingAdminService_ListGatewaySubscribers_Call struct {
	*mock.Call
}

MockBillingAdminService_ListGatewaySubscribers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListGatewaySubscribers'

func (*MockBillingAdminService_ListGatewaySubscribers_Call) Return

func (*MockBillingAdminService_ListGatewaySubscribers_Call) Run

func (*MockBillingAdminService_ListGatewaySubscribers_Call) RunAndReturn

type MockBillingAdminService_ListPriceLines_Call

type MockBillingAdminService_ListPriceLines_Call struct {
	*mock.Call
}

MockBillingAdminService_ListPriceLines_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPriceLines'

func (*MockBillingAdminService_ListPriceLines_Call) Return

func (*MockBillingAdminService_ListPriceLines_Call) Run

func (*MockBillingAdminService_ListPriceLines_Call) RunAndReturn

type MockBillingAdminService_ListPricingPlanPeriods_Call

type MockBillingAdminService_ListPricingPlanPeriods_Call struct {
	*mock.Call
}

MockBillingAdminService_ListPricingPlanPeriods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPricingPlanPeriods'

func (*MockBillingAdminService_ListPricingPlanPeriods_Call) Return

func (*MockBillingAdminService_ListPricingPlanPeriods_Call) Run

func (*MockBillingAdminService_ListPricingPlanPeriods_Call) RunAndReturn

type MockBillingAdminService_ListPricingPlans_Call

type MockBillingAdminService_ListPricingPlans_Call struct {
	*mock.Call
}

MockBillingAdminService_ListPricingPlans_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPricingPlans'

func (*MockBillingAdminService_ListPricingPlans_Call) Return

func (*MockBillingAdminService_ListPricingPlans_Call) Run

func (*MockBillingAdminService_ListPricingPlans_Call) RunAndReturn

type MockBillingAdminService_ListSubscribers_Call

type MockBillingAdminService_ListSubscribers_Call struct {
	*mock.Call
}

MockBillingAdminService_ListSubscribers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSubscribers'

func (*MockBillingAdminService_ListSubscribers_Call) Return

func (*MockBillingAdminService_ListSubscribers_Call) Run

func (*MockBillingAdminService_ListSubscribers_Call) RunAndReturn

type MockBillingAdminService_PauseUserSubscription_Call

type MockBillingAdminService_PauseUserSubscription_Call struct {
	*mock.Call
}

MockBillingAdminService_PauseUserSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PauseUserSubscription'

func (*MockBillingAdminService_PauseUserSubscription_Call) Return

func (*MockBillingAdminService_PauseUserSubscription_Call) Run

func (*MockBillingAdminService_PauseUserSubscription_Call) RunAndReturn

type MockBillingAdminService_PurgeCredits_Call

type MockBillingAdminService_PurgeCredits_Call struct {
	*mock.Call
}

MockBillingAdminService_PurgeCredits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PurgeCredits'

func (*MockBillingAdminService_PurgeCredits_Call) Return

func (*MockBillingAdminService_PurgeCredits_Call) Run

func (*MockBillingAdminService_PurgeCredits_Call) RunAndReturn

type MockBillingAdminService_RequireAuthenticated_Call

type MockBillingAdminService_RequireAuthenticated_Call struct {
	*mock.Call
}

MockBillingAdminService_RequireAuthenticated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequireAuthenticated'

func (*MockBillingAdminService_RequireAuthenticated_Call) Return

func (*MockBillingAdminService_RequireAuthenticated_Call) Run

func (*MockBillingAdminService_RequireAuthenticated_Call) RunAndReturn

type MockBillingAdminService_RestoreCredit_Call

type MockBillingAdminService_RestoreCredit_Call struct {
	*mock.Call
}

MockBillingAdminService_RestoreCredit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestoreCredit'

func (*MockBillingAdminService_RestoreCredit_Call) Return

func (*MockBillingAdminService_RestoreCredit_Call) Run

func (*MockBillingAdminService_RestoreCredit_Call) RunAndReturn

type MockBillingAdminService_ResumeUserSubscription_Call

type MockBillingAdminService_ResumeUserSubscription_Call struct {
	*mock.Call
}

MockBillingAdminService_ResumeUserSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResumeUserSubscription'

func (*MockBillingAdminService_ResumeUserSubscription_Call) Return

func (*MockBillingAdminService_ResumeUserSubscription_Call) Run

func (*MockBillingAdminService_ResumeUserSubscription_Call) RunAndReturn

type MockBillingAdminService_SyncAllPricingPlans_Call

type MockBillingAdminService_SyncAllPricingPlans_Call struct {
	*mock.Call
}

MockBillingAdminService_SyncAllPricingPlans_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncAllPricingPlans'

func (*MockBillingAdminService_SyncAllPricingPlans_Call) Return

func (*MockBillingAdminService_SyncAllPricingPlans_Call) Run

func (*MockBillingAdminService_SyncAllPricingPlans_Call) RunAndReturn

type MockBillingAdminService_SyncPricingPlan_Call

type MockBillingAdminService_SyncPricingPlan_Call struct {
	*mock.Call
}

MockBillingAdminService_SyncPricingPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncPricingPlan'

func (*MockBillingAdminService_SyncPricingPlan_Call) Return

func (*MockBillingAdminService_SyncPricingPlan_Call) Run

func (*MockBillingAdminService_SyncPricingPlan_Call) RunAndReturn

type MockBillingAdminService_UpdatePlanPosition_Call

type MockBillingAdminService_UpdatePlanPosition_Call struct {
	*mock.Call
}

MockBillingAdminService_UpdatePlanPosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePlanPosition'

func (*MockBillingAdminService_UpdatePlanPosition_Call) Return

func (*MockBillingAdminService_UpdatePlanPosition_Call) Run

func (*MockBillingAdminService_UpdatePlanPosition_Call) RunAndReturn

type MockBillingAdminService_UpdatePriceLine_Call

type MockBillingAdminService_UpdatePriceLine_Call struct {
	*mock.Call
}

MockBillingAdminService_UpdatePriceLine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePriceLine'

func (*MockBillingAdminService_UpdatePriceLine_Call) Return

func (*MockBillingAdminService_UpdatePriceLine_Call) Run

func (*MockBillingAdminService_UpdatePriceLine_Call) RunAndReturn

type MockBillingAdminService_UpdatePricingPlanPeriod_Call

type MockBillingAdminService_UpdatePricingPlanPeriod_Call struct {
	*mock.Call
}

MockBillingAdminService_UpdatePricingPlanPeriod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePricingPlanPeriod'

func (*MockBillingAdminService_UpdatePricingPlanPeriod_Call) Return

func (*MockBillingAdminService_UpdatePricingPlanPeriod_Call) Run

func (*MockBillingAdminService_UpdatePricingPlanPeriod_Call) RunAndReturn

type MockBillingAdminService_UpdatePricingPlan_Call

type MockBillingAdminService_UpdatePricingPlan_Call struct {
	*mock.Call
}

MockBillingAdminService_UpdatePricingPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePricingPlan'

func (*MockBillingAdminService_UpdatePricingPlan_Call) Return

func (*MockBillingAdminService_UpdatePricingPlan_Call) Run

func (*MockBillingAdminService_UpdatePricingPlan_Call) RunAndReturn

type MockPinningService

type MockPinningService struct {
	mock.Mock
}

MockPinningService is an autogenerated mock type for the PinningService type

func NewMockPinningService

func NewMockPinningService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockPinningService

NewMockPinningService creates a new instance of MockPinningService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockPinningService) EXPECT

func (*MockPinningService) List

func (_mock *MockPinningService) List(ctx context.Context, nameFilter string, limit int, statusFilter string) ([]Pin, error)

List provides a mock function for the type MockPinningService

func (*MockPinningService) Pin

func (_mock *MockPinningService) Pin(ctx context.Context, cid string, name string, wait bool) (*PinResult, error)

Pin provides a mock function for the type MockPinningService

func (*MockPinningService) PinBatch

func (_mock *MockPinningService) PinBatch(ctx context.Context, cids []string, name string, opts BatchOptions) (*BatchResult, error)

PinBatch provides a mock function for the type MockPinningService

func (*MockPinningService) RequireAuthenticated

func (_mock *MockPinningService) RequireAuthenticated() error

RequireAuthenticated provides a mock function for the type MockPinningService

func (*MockPinningService) Status

func (_mock *MockPinningService) Status(ctx context.Context, cid string, watch bool) (*PinStatus, error)

Status provides a mock function for the type MockPinningService

func (*MockPinningService) Unpin

func (_mock *MockPinningService) Unpin(ctx context.Context, cid string, confirm bool) (*UnpinResult, error)

Unpin provides a mock function for the type MockPinningService

func (*MockPinningService) UnpinBatch

func (_mock *MockPinningService) UnpinBatch(ctx context.Context, cids []string, opts BatchOptions) (*BatchResult, error)

UnpinBatch provides a mock function for the type MockPinningService

func (*MockPinningService) UpdateMetadata

func (_mock *MockPinningService) UpdateMetadata(ctx context.Context, cid string, set []string, clear bool) error

UpdateMetadata provides a mock function for the type MockPinningService

type MockPinningService_Expecter

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

func (*MockPinningService_Expecter) List

func (_e *MockPinningService_Expecter) List(ctx interface{}, nameFilter interface{}, limit interface{}, statusFilter interface{}) *MockPinningService_List_Call

List is a helper method to define mock.On call

  • ctx context.Context
  • nameFilter string
  • limit int
  • statusFilter string

func (*MockPinningService_Expecter) Pin

func (_e *MockPinningService_Expecter) Pin(ctx interface{}, cid interface{}, name interface{}, wait interface{}) *MockPinningService_Pin_Call

Pin is a helper method to define mock.On call

  • ctx context.Context
  • cid string
  • name string
  • wait bool

func (*MockPinningService_Expecter) PinBatch

func (_e *MockPinningService_Expecter) PinBatch(ctx interface{}, cids interface{}, name interface{}, opts interface{}) *MockPinningService_PinBatch_Call

PinBatch is a helper method to define mock.On call

  • ctx context.Context
  • cids []string
  • name string
  • opts BatchOptions

func (*MockPinningService_Expecter) RequireAuthenticated

RequireAuthenticated is a helper method to define mock.On call

func (*MockPinningService_Expecter) Status

func (_e *MockPinningService_Expecter) Status(ctx interface{}, cid interface{}, watch interface{}) *MockPinningService_Status_Call

Status is a helper method to define mock.On call

  • ctx context.Context
  • cid string
  • watch bool

func (*MockPinningService_Expecter) Unpin

func (_e *MockPinningService_Expecter) Unpin(ctx interface{}, cid interface{}, confirm interface{}) *MockPinningService_Unpin_Call

Unpin is a helper method to define mock.On call

  • ctx context.Context
  • cid string
  • confirm bool

func (*MockPinningService_Expecter) UnpinBatch

func (_e *MockPinningService_Expecter) UnpinBatch(ctx interface{}, cids interface{}, opts interface{}) *MockPinningService_UnpinBatch_Call

UnpinBatch is a helper method to define mock.On call

  • ctx context.Context
  • cids []string
  • opts BatchOptions

func (*MockPinningService_Expecter) UpdateMetadata

func (_e *MockPinningService_Expecter) UpdateMetadata(ctx interface{}, cid interface{}, set interface{}, clear interface{}) *MockPinningService_UpdateMetadata_Call

UpdateMetadata is a helper method to define mock.On call

  • ctx context.Context
  • cid string
  • set []string
  • clear bool

type MockPinningService_List_Call

type MockPinningService_List_Call struct {
	*mock.Call
}

MockPinningService_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'

func (*MockPinningService_List_Call) Return

func (*MockPinningService_List_Call) Run

func (_c *MockPinningService_List_Call) Run(run func(ctx context.Context, nameFilter string, limit int, statusFilter string)) *MockPinningService_List_Call

func (*MockPinningService_List_Call) RunAndReturn

func (_c *MockPinningService_List_Call) RunAndReturn(run func(ctx context.Context, nameFilter string, limit int, statusFilter string) ([]Pin, error)) *MockPinningService_List_Call

type MockPinningService_PinBatch_Call

type MockPinningService_PinBatch_Call struct {
	*mock.Call
}

MockPinningService_PinBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PinBatch'

func (*MockPinningService_PinBatch_Call) Return

func (*MockPinningService_PinBatch_Call) Run

func (*MockPinningService_PinBatch_Call) RunAndReturn

type MockPinningService_Pin_Call

type MockPinningService_Pin_Call struct {
	*mock.Call
}

MockPinningService_Pin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pin'

func (*MockPinningService_Pin_Call) Return

func (*MockPinningService_Pin_Call) Run

func (_c *MockPinningService_Pin_Call) Run(run func(ctx context.Context, cid string, name string, wait bool)) *MockPinningService_Pin_Call

func (*MockPinningService_Pin_Call) RunAndReturn

func (_c *MockPinningService_Pin_Call) RunAndReturn(run func(ctx context.Context, cid string, name string, wait bool) (*PinResult, error)) *MockPinningService_Pin_Call

type MockPinningService_RequireAuthenticated_Call

type MockPinningService_RequireAuthenticated_Call struct {
	*mock.Call
}

MockPinningService_RequireAuthenticated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequireAuthenticated'

func (*MockPinningService_RequireAuthenticated_Call) Return

func (*MockPinningService_RequireAuthenticated_Call) Run

func (*MockPinningService_RequireAuthenticated_Call) RunAndReturn

type MockPinningService_Status_Call

type MockPinningService_Status_Call struct {
	*mock.Call
}

MockPinningService_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status'

func (*MockPinningService_Status_Call) Return

func (*MockPinningService_Status_Call) Run

func (*MockPinningService_Status_Call) RunAndReturn

type MockPinningService_UnpinBatch_Call

type MockPinningService_UnpinBatch_Call struct {
	*mock.Call
}

MockPinningService_UnpinBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnpinBatch'

func (*MockPinningService_UnpinBatch_Call) Return

func (*MockPinningService_UnpinBatch_Call) Run

func (*MockPinningService_UnpinBatch_Call) RunAndReturn

type MockPinningService_Unpin_Call

type MockPinningService_Unpin_Call struct {
	*mock.Call
}

MockPinningService_Unpin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unpin'

func (*MockPinningService_Unpin_Call) Return

func (*MockPinningService_Unpin_Call) Run

func (*MockPinningService_Unpin_Call) RunAndReturn

func (_c *MockPinningService_Unpin_Call) RunAndReturn(run func(ctx context.Context, cid string, confirm bool) (*UnpinResult, error)) *MockPinningService_Unpin_Call

type MockPinningService_UpdateMetadata_Call

type MockPinningService_UpdateMetadata_Call struct {
	*mock.Call
}

MockPinningService_UpdateMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateMetadata'

func (*MockPinningService_UpdateMetadata_Call) Return

func (*MockPinningService_UpdateMetadata_Call) Run

func (*MockPinningService_UpdateMetadata_Call) RunAndReturn

type MockQuotaAdminService

type MockQuotaAdminService struct {
	mock.Mock
}

MockQuotaAdminService is an autogenerated mock type for the QuotaAdminService type

func NewMockQuotaAdminService

func NewMockQuotaAdminService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockQuotaAdminService

NewMockQuotaAdminService creates a new instance of MockQuotaAdminService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockQuotaAdminService) Cleanup

func (_mock *MockQuotaAdminService) Cleanup(ctx context.Context, retentionDays int) (int, error)

Cleanup provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) CreateAllowance

func (_mock *MockQuotaAdminService) CreateAllowance(ctx context.Context, userID int, source string, allowanceType string, upload int, download int, storage int, expiryDate time.Time) (*admin.QuotaAllowance, error)

CreateAllowance provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) CreatePlan

func (_mock *MockQuotaAdminService) CreatePlan(ctx context.Context, plan *admin.QuotaPlan) (*admin.QuotaPlan, error)

CreatePlan provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) DeleteAllowance

func (_mock *MockQuotaAdminService) DeleteAllowance(ctx context.Context, grantID string) error

DeleteAllowance provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) DeletePlan

func (_mock *MockQuotaAdminService) DeletePlan(ctx context.Context, planID string) error

DeletePlan provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) EXPECT

func (*MockQuotaAdminService) GetPlan

func (_mock *MockQuotaAdminService) GetPlan(ctx context.Context, planID string) (*admin.QuotaPlan, error)

GetPlan provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) GetStats

func (_mock *MockQuotaAdminService) GetStats(ctx context.Context) (*admin.SystemStats, error)

GetStats provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) ListAllowances

func (_mock *MockQuotaAdminService) ListAllowances(ctx context.Context) ([]*admin.QuotaAllowance, int, error)

ListAllowances provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) ListPlans

func (_mock *MockQuotaAdminService) ListPlans(ctx context.Context) ([]*admin.QuotaPlan, int, error)

ListPlans provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) ListUserConfigs

func (_mock *MockQuotaAdminService) ListUserConfigs(ctx context.Context) ([]*admin.UserQuotaConfig, int, error)

ListUserConfigs provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) Reconcile

func (_mock *MockQuotaAdminService) Reconcile(ctx context.Context, userID *int) (string, int, error)

Reconcile provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) RequireAuthenticated

func (_mock *MockQuotaAdminService) RequireAuthenticated() error

RequireAuthenticated provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) ResetUserPlan

func (_mock *MockQuotaAdminService) ResetUserPlan(ctx context.Context, userID int) error

ResetUserPlan provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) SetDefaultPlan

func (_mock *MockQuotaAdminService) SetDefaultPlan(ctx context.Context, planID string) error

SetDefaultPlan provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) UpdateAllowance

func (_mock *MockQuotaAdminService) UpdateAllowance(ctx context.Context, grantID string, userID int, source string, allowanceType string, upload int, download int, storage int, expiryDate time.Time) (*admin.QuotaAllowance, error)

UpdateAllowance provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) UpdatePlan

func (_mock *MockQuotaAdminService) UpdatePlan(ctx context.Context, planID string, plan *admin.QuotaPlan) (*admin.QuotaPlan, error)

UpdatePlan provides a mock function for the type MockQuotaAdminService

func (*MockQuotaAdminService) UpdateUserConfig

func (_mock *MockQuotaAdminService) UpdateUserConfig(ctx context.Context, userID int, config *admin.UserQuotaConfigUpdate) (*admin.UserQuotaConfig, error)

UpdateUserConfig provides a mock function for the type MockQuotaAdminService

type MockQuotaAdminService_Cleanup_Call

type MockQuotaAdminService_Cleanup_Call struct {
	*mock.Call
}

MockQuotaAdminService_Cleanup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cleanup'

func (*MockQuotaAdminService_Cleanup_Call) Return

func (*MockQuotaAdminService_Cleanup_Call) Run

func (*MockQuotaAdminService_Cleanup_Call) RunAndReturn

func (_c *MockQuotaAdminService_Cleanup_Call) RunAndReturn(run func(ctx context.Context, retentionDays int) (int, error)) *MockQuotaAdminService_Cleanup_Call

type MockQuotaAdminService_CreateAllowance_Call

type MockQuotaAdminService_CreateAllowance_Call struct {
	*mock.Call
}

MockQuotaAdminService_CreateAllowance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAllowance'

func (*MockQuotaAdminService_CreateAllowance_Call) Return

func (*MockQuotaAdminService_CreateAllowance_Call) Run

func (_c *MockQuotaAdminService_CreateAllowance_Call) Run(run func(ctx context.Context, userID int, source string, allowanceType string, upload int, download int, storage int, expiryDate time.Time)) *MockQuotaAdminService_CreateAllowance_Call

func (*MockQuotaAdminService_CreateAllowance_Call) RunAndReturn

func (_c *MockQuotaAdminService_CreateAllowance_Call) RunAndReturn(run func(ctx context.Context, userID int, source string, allowanceType string, upload int, download int, storage int, expiryDate time.Time) (*admin.QuotaAllowance, error)) *MockQuotaAdminService_CreateAllowance_Call

type MockQuotaAdminService_CreatePlan_Call

type MockQuotaAdminService_CreatePlan_Call struct {
	*mock.Call
}

MockQuotaAdminService_CreatePlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatePlan'

func (*MockQuotaAdminService_CreatePlan_Call) Return

func (*MockQuotaAdminService_CreatePlan_Call) Run

func (*MockQuotaAdminService_CreatePlan_Call) RunAndReturn

type MockQuotaAdminService_DeleteAllowance_Call

type MockQuotaAdminService_DeleteAllowance_Call struct {
	*mock.Call
}

MockQuotaAdminService_DeleteAllowance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAllowance'

func (*MockQuotaAdminService_DeleteAllowance_Call) Return

func (*MockQuotaAdminService_DeleteAllowance_Call) Run

func (*MockQuotaAdminService_DeleteAllowance_Call) RunAndReturn

type MockQuotaAdminService_DeletePlan_Call

type MockQuotaAdminService_DeletePlan_Call struct {
	*mock.Call
}

MockQuotaAdminService_DeletePlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePlan'

func (*MockQuotaAdminService_DeletePlan_Call) Return

func (*MockQuotaAdminService_DeletePlan_Call) Run

func (*MockQuotaAdminService_DeletePlan_Call) RunAndReturn

type MockQuotaAdminService_Expecter

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

func (*MockQuotaAdminService_Expecter) Cleanup

func (_e *MockQuotaAdminService_Expecter) Cleanup(ctx interface{}, retentionDays interface{}) *MockQuotaAdminService_Cleanup_Call

Cleanup is a helper method to define mock.On call

  • ctx context.Context
  • retentionDays int

func (*MockQuotaAdminService_Expecter) CreateAllowance

func (_e *MockQuotaAdminService_Expecter) CreateAllowance(ctx interface{}, userID interface{}, source interface{}, allowanceType interface{}, upload interface{}, download interface{}, storage interface{}, expiryDate interface{}) *MockQuotaAdminService_CreateAllowance_Call

CreateAllowance is a helper method to define mock.On call

  • ctx context.Context
  • userID int
  • source string
  • allowanceType string
  • upload int
  • download int
  • storage int
  • expiryDate time.Time

func (*MockQuotaAdminService_Expecter) CreatePlan

func (_e *MockQuotaAdminService_Expecter) CreatePlan(ctx interface{}, plan interface{}) *MockQuotaAdminService_CreatePlan_Call

CreatePlan is a helper method to define mock.On call

  • ctx context.Context
  • plan *admin.QuotaPlan

func (*MockQuotaAdminService_Expecter) DeleteAllowance

func (_e *MockQuotaAdminService_Expecter) DeleteAllowance(ctx interface{}, grantID interface{}) *MockQuotaAdminService_DeleteAllowance_Call

DeleteAllowance is a helper method to define mock.On call

  • ctx context.Context
  • grantID string

func (*MockQuotaAdminService_Expecter) DeletePlan

func (_e *MockQuotaAdminService_Expecter) DeletePlan(ctx interface{}, planID interface{}) *MockQuotaAdminService_DeletePlan_Call

DeletePlan is a helper method to define mock.On call

  • ctx context.Context
  • planID string

func (*MockQuotaAdminService_Expecter) GetPlan

func (_e *MockQuotaAdminService_Expecter) GetPlan(ctx interface{}, planID interface{}) *MockQuotaAdminService_GetPlan_Call

GetPlan is a helper method to define mock.On call

  • ctx context.Context
  • planID string

func (*MockQuotaAdminService_Expecter) GetStats

GetStats is a helper method to define mock.On call

  • ctx context.Context

func (*MockQuotaAdminService_Expecter) ListAllowances

ListAllowances is a helper method to define mock.On call

  • ctx context.Context

func (*MockQuotaAdminService_Expecter) ListPlans

ListPlans is a helper method to define mock.On call

  • ctx context.Context

func (*MockQuotaAdminService_Expecter) ListUserConfigs

func (_e *MockQuotaAdminService_Expecter) ListUserConfigs(ctx interface{}) *MockQuotaAdminService_ListUserConfigs_Call

ListUserConfigs is a helper method to define mock.On call

  • ctx context.Context

func (*MockQuotaAdminService_Expecter) Reconcile

func (_e *MockQuotaAdminService_Expecter) Reconcile(ctx interface{}, userID interface{}) *MockQuotaAdminService_Reconcile_Call

Reconcile is a helper method to define mock.On call

  • ctx context.Context
  • userID *int

func (*MockQuotaAdminService_Expecter) RequireAuthenticated

RequireAuthenticated is a helper method to define mock.On call

func (*MockQuotaAdminService_Expecter) ResetUserPlan

func (_e *MockQuotaAdminService_Expecter) ResetUserPlan(ctx interface{}, userID interface{}) *MockQuotaAdminService_ResetUserPlan_Call

ResetUserPlan is a helper method to define mock.On call

  • ctx context.Context
  • userID int

func (*MockQuotaAdminService_Expecter) SetDefaultPlan

func (_e *MockQuotaAdminService_Expecter) SetDefaultPlan(ctx interface{}, planID interface{}) *MockQuotaAdminService_SetDefaultPlan_Call

SetDefaultPlan is a helper method to define mock.On call

  • ctx context.Context
  • planID string

func (*MockQuotaAdminService_Expecter) UpdateAllowance

func (_e *MockQuotaAdminService_Expecter) UpdateAllowance(ctx interface{}, grantID interface{}, userID interface{}, source interface{}, allowanceType interface{}, upload interface{}, download interface{}, storage interface{}, expiryDate interface{}) *MockQuotaAdminService_UpdateAllowance_Call

UpdateAllowance is a helper method to define mock.On call

  • ctx context.Context
  • grantID string
  • userID int
  • source string
  • allowanceType string
  • upload int
  • download int
  • storage int
  • expiryDate time.Time

func (*MockQuotaAdminService_Expecter) UpdatePlan

func (_e *MockQuotaAdminService_Expecter) UpdatePlan(ctx interface{}, planID interface{}, plan interface{}) *MockQuotaAdminService_UpdatePlan_Call

UpdatePlan is a helper method to define mock.On call

  • ctx context.Context
  • planID string
  • plan *admin.QuotaPlan

func (*MockQuotaAdminService_Expecter) UpdateUserConfig

func (_e *MockQuotaAdminService_Expecter) UpdateUserConfig(ctx interface{}, userID interface{}, config interface{}) *MockQuotaAdminService_UpdateUserConfig_Call

UpdateUserConfig is a helper method to define mock.On call

  • ctx context.Context
  • userID int
  • config *admin.UserQuotaConfigUpdate

type MockQuotaAdminService_GetPlan_Call

type MockQuotaAdminService_GetPlan_Call struct {
	*mock.Call
}

MockQuotaAdminService_GetPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPlan'

func (*MockQuotaAdminService_GetPlan_Call) Return

func (*MockQuotaAdminService_GetPlan_Call) Run

func (*MockQuotaAdminService_GetPlan_Call) RunAndReturn

type MockQuotaAdminService_GetStats_Call

type MockQuotaAdminService_GetStats_Call struct {
	*mock.Call
}

MockQuotaAdminService_GetStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStats'

func (*MockQuotaAdminService_GetStats_Call) Return

func (*MockQuotaAdminService_GetStats_Call) Run

func (*MockQuotaAdminService_GetStats_Call) RunAndReturn

type MockQuotaAdminService_ListAllowances_Call

type MockQuotaAdminService_ListAllowances_Call struct {
	*mock.Call
}

MockQuotaAdminService_ListAllowances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllowances'

func (*MockQuotaAdminService_ListAllowances_Call) Return

func (*MockQuotaAdminService_ListAllowances_Call) Run

func (*MockQuotaAdminService_ListAllowances_Call) RunAndReturn

type MockQuotaAdminService_ListPlans_Call

type MockQuotaAdminService_ListPlans_Call struct {
	*mock.Call
}

MockQuotaAdminService_ListPlans_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPlans'

func (*MockQuotaAdminService_ListPlans_Call) Return

func (*MockQuotaAdminService_ListPlans_Call) Run

func (*MockQuotaAdminService_ListPlans_Call) RunAndReturn

type MockQuotaAdminService_ListUserConfigs_Call

type MockQuotaAdminService_ListUserConfigs_Call struct {
	*mock.Call
}

MockQuotaAdminService_ListUserConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListUserConfigs'

func (*MockQuotaAdminService_ListUserConfigs_Call) Return

func (*MockQuotaAdminService_ListUserConfigs_Call) Run

func (*MockQuotaAdminService_ListUserConfigs_Call) RunAndReturn

type MockQuotaAdminService_Reconcile_Call

type MockQuotaAdminService_Reconcile_Call struct {
	*mock.Call
}

MockQuotaAdminService_Reconcile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reconcile'

func (*MockQuotaAdminService_Reconcile_Call) Return

func (*MockQuotaAdminService_Reconcile_Call) Run

func (*MockQuotaAdminService_Reconcile_Call) RunAndReturn

type MockQuotaAdminService_RequireAuthenticated_Call

type MockQuotaAdminService_RequireAuthenticated_Call struct {
	*mock.Call
}

MockQuotaAdminService_RequireAuthenticated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequireAuthenticated'

func (*MockQuotaAdminService_RequireAuthenticated_Call) Return

func (*MockQuotaAdminService_RequireAuthenticated_Call) Run

func (*MockQuotaAdminService_RequireAuthenticated_Call) RunAndReturn

type MockQuotaAdminService_ResetUserPlan_Call

type MockQuotaAdminService_ResetUserPlan_Call struct {
	*mock.Call
}

MockQuotaAdminService_ResetUserPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetUserPlan'

func (*MockQuotaAdminService_ResetUserPlan_Call) Return

func (*MockQuotaAdminService_ResetUserPlan_Call) Run

func (*MockQuotaAdminService_ResetUserPlan_Call) RunAndReturn

type MockQuotaAdminService_SetDefaultPlan_Call

type MockQuotaAdminService_SetDefaultPlan_Call struct {
	*mock.Call
}

MockQuotaAdminService_SetDefaultPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDefaultPlan'

func (*MockQuotaAdminService_SetDefaultPlan_Call) Return

func (*MockQuotaAdminService_SetDefaultPlan_Call) Run

func (*MockQuotaAdminService_SetDefaultPlan_Call) RunAndReturn

type MockQuotaAdminService_UpdateAllowance_Call

type MockQuotaAdminService_UpdateAllowance_Call struct {
	*mock.Call
}

MockQuotaAdminService_UpdateAllowance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAllowance'

func (*MockQuotaAdminService_UpdateAllowance_Call) Return

func (*MockQuotaAdminService_UpdateAllowance_Call) Run

func (_c *MockQuotaAdminService_UpdateAllowance_Call) Run(run func(ctx context.Context, grantID string, userID int, source string, allowanceType string, upload int, download int, storage int, expiryDate time.Time)) *MockQuotaAdminService_UpdateAllowance_Call

func (*MockQuotaAdminService_UpdateAllowance_Call) RunAndReturn

func (_c *MockQuotaAdminService_UpdateAllowance_Call) RunAndReturn(run func(ctx context.Context, grantID string, userID int, source string, allowanceType string, upload int, download int, storage int, expiryDate time.Time) (*admin.QuotaAllowance, error)) *MockQuotaAdminService_UpdateAllowance_Call

type MockQuotaAdminService_UpdatePlan_Call

type MockQuotaAdminService_UpdatePlan_Call struct {
	*mock.Call
}

MockQuotaAdminService_UpdatePlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePlan'

func (*MockQuotaAdminService_UpdatePlan_Call) Return

func (*MockQuotaAdminService_UpdatePlan_Call) Run

func (*MockQuotaAdminService_UpdatePlan_Call) RunAndReturn

type MockQuotaAdminService_UpdateUserConfig_Call

type MockQuotaAdminService_UpdateUserConfig_Call struct {
	*mock.Call
}

MockQuotaAdminService_UpdateUserConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUserConfig'

func (*MockQuotaAdminService_UpdateUserConfig_Call) Return

func (*MockQuotaAdminService_UpdateUserConfig_Call) Run

func (*MockQuotaAdminService_UpdateUserConfig_Call) RunAndReturn

type MockSetupUI

type MockSetupUI struct {

	// Track method calls
	Calls []string

	// Track execution choices
	AuthChoice   AuthStepChoice
	ConfigChoice ConfigStepChoice
	CustomConfig CustomConfig
	Email        string
	Password     string
	OTPCode      string
	PromptError  error

	// Control behavior
	ReturnError   error
	ContinueError error

	// Track state
	WelcomeShown     bool
	CompletionShown  bool
	AuthExecuted     bool
	ConfigExecuted   bool
	TutorialExecuted bool

	// Track config changes for testing
	EndpointSet string
	SecureSet   *bool
	// contains filtered or unexported fields
}

MockSetupUI is a mock implementation of SetupUI for testing. Tests verify method calls and state, not display strings.

func NewMockSetupUI

func NewMockSetupUI() *MockSetupUI

NewMockSetupUI creates a new mock UI.

func (*MockSetupUI) CallCount

func (m *MockSetupUI) CallCount(method string) int

CallCount returns the number of times a method was called.

func (*MockSetupUI) ClearCalls

func (m *MockSetupUI) ClearCalls()

ClearCalls clears the call history.

func (*MockSetupUI) ExecuteAuthStep

func (m *MockSetupUI) ExecuteAuthStep(ctx context.Context, wizard *SetupWizard) error

ExecuteAuthStep implements SetupUI.

func (*MockSetupUI) ExecuteCompletionStep

func (m *MockSetupUI) ExecuteCompletionStep(wizard *SetupWizard) error

ExecuteCompletionStep implements SetupUI.

func (*MockSetupUI) ExecuteConfigStep

func (m *MockSetupUI) ExecuteConfigStep(ctx context.Context, wizard *SetupWizard) error

ExecuteConfigStep implements SetupUI.

func (*MockSetupUI) ExecuteTutorialStep

func (m *MockSetupUI) ExecuteTutorialStep(wizard *SetupWizard) error

ExecuteTutorialStep implements SetupUI.

func (*MockSetupUI) GetCalls

func (m *MockSetupUI) GetCalls() []string

GetCalls returns a copy of the method calls.

func (*MockSetupUI) SetAuthChoice

func (m *MockSetupUI) SetAuthChoice(choice AuthStepChoice)

SetAuthChoice sets the mock's auth choice response.

func (*MockSetupUI) SetConfigChoice

func (m *MockSetupUI) SetConfigChoice(choice ConfigStepChoice)

SetConfigChoice sets the mock's config choice response.

func (*MockSetupUI) SetCredentials

func (m *MockSetupUI) SetCredentials(email, password string)

SetCredentials sets the mock's email/password response.

func (*MockSetupUI) SetCustomConfig

func (m *MockSetupUI) SetCustomConfig(config CustomConfig)

SetCustomConfig sets the mock's custom config response.

func (*MockSetupUI) SetOTPCode

func (m *MockSetupUI) SetOTPCode(code string)

SetOTPCode sets the mock's OTP code response.

func (*MockSetupUI) SetReturnError

func (m *MockSetupUI) SetReturnError(err error)

SetReturnError sets an error to return from the next UI call.

func (*MockSetupUI) ShowCompletion

func (m *MockSetupUI) ShowCompletion() error

ShowCompletion implements SetupUI.

func (*MockSetupUI) ShowStepProgress

func (m *MockSetupUI) ShowStepProgress(ctx context.Context, current, total int, stepName string) error

ShowStepProgress implements SetupUI.

func (*MockSetupUI) ShowStepSkipped

func (m *MockSetupUI) ShowStepSkipped(ctx context.Context, stepName string) error

ShowStepSkipped implements SetupUI.

func (*MockSetupUI) ShowWelcome

func (m *MockSetupUI) ShowWelcome() error

ShowWelcome implements SetupUI.

func (*MockSetupUI) VerifyCalls

func (m *MockSetupUI) VerifyCalls(expected []string) bool

VerifyCalls verifies that methods were called in the expected order.

func (*MockSetupUI) WasCalled

func (m *MockSetupUI) WasCalled(method string) bool

WasCalled checks if a specific method was called.

type MockUploadService

type MockUploadService struct {
	mock.Mock
}

MockUploadService is an autogenerated mock type for the UploadService type

func NewMockUploadService

func NewMockUploadService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockUploadService

NewMockUploadService creates a new instance of MockUploadService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockUploadService) EXPECT

func (*MockUploadService) Upload

func (_mock *MockUploadService) Upload(ctx context.Context, filesystem fs.FS, name string, wait bool) (*UploadResult, error)

Upload provides a mock function for the type MockUploadService

type MockUploadService_Expecter

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

func (*MockUploadService_Expecter) Upload

func (_e *MockUploadService_Expecter) Upload(ctx interface{}, filesystem interface{}, name interface{}, wait interface{}) *MockUploadService_Upload_Call

Upload is a helper method to define mock.On call

  • ctx context.Context
  • filesystem fs.FS
  • name string
  • wait bool

type MockUploadService_Upload_Call

type MockUploadService_Upload_Call struct {
	*mock.Call
}

MockUploadService_Upload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upload'

func (*MockUploadService_Upload_Call) Return

func (*MockUploadService_Upload_Call) Run

func (_c *MockUploadService_Upload_Call) Run(run func(ctx context.Context, filesystem fs.FS, name string, wait bool)) *MockUploadService_Upload_Call

func (*MockUploadService_Upload_Call) RunAndReturn

func (_c *MockUploadService_Upload_Call) RunAndReturn(run func(ctx context.Context, filesystem fs.FS, name string, wait bool) (*UploadResult, error)) *MockUploadService_Upload_Call

type OperationError

type OperationError struct {
	CID   string
	Error string
}

OperationError represents a failed operation in a batch

type OperationResult

type OperationResult struct {
	CID       string
	RequestID string
	Status    string
}

OperationResult represents a successful operation in a batch

type Output

type Output interface {
	// Print prints a message to the output.
	Print(message string)

	// Printf formats and prints a message to the output.
	Printf(format string, args ...any)

	// Printfln formats and prints a message to the output with a newline.
	Printfln(format string, args ...any)

	// PrintJSON prints data as JSON to the output.
	PrintJSON(data any) error

	// PrintVerbose prints a message only if verbose mode is enabled.
	PrintVerbose(message string)

	// PrintVerbosef formats and prints a message only if verbose mode is enabled.
	PrintVerbosef(format string, args ...any)

	// PrintError prints an error message to stderr.
	PrintError(err error)

	// SetWriter sets the output writer.
	SetWriter(w io.Writer)

	// IsJSON returns true if JSON output is enabled.
	IsJSON() bool

	// IsVerbose returns true if verbose mode is enabled.
	IsVerbose() bool

	// IsQuiet returns true if quiet mode is enabled.
	IsQuiet() bool

	// IsUnmask returns true if unmask mode is enabled.
	IsUnmask() bool

	// PrintTable prints data as a formatted table.
	PrintTable(headers []string, rows [][]string)

	// PrintList prints items as a bulleted list.
	PrintList(items []string)

	// MaskSensitive masks sensitive data like tokens, passwords, etc.
	MaskSensitive(value, key string) string

	// PrintFields renders a titled group of labeled fields.
	PrintFields(group FieldGroup)

	// PrintListGroup renders a titled group with fields and an optional item list.
	PrintListGroup(group ListGroup)

	// Watch continuously monitors and displays updates for the provided data fetcher.
	// Returns when all items reach terminal status or context is cancelled.
	Watch(ctx context.Context, fetcher func(context.Context) (any, error), formatter func(any) (string, []string, [][]string)) error
}

Output defines the interface for CLI output formatting.

func NewOutputFormatter

func NewOutputFormatter(json, verbose, quiet, unmask bool) Output

NewOutputFormatter creates a new output formatter based on configuration.

type PTermSetupUI

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

PTermSetupUI implements SetupUI using PTerm for display. This is the production UI layer - tests use mocks.

func NewPTermSetupUI

func NewPTermSetupUI(output Output) *PTermSetupUI

NewPTermSetupUI creates a new PTerm-based UI.

func (*PTermSetupUI) ExecuteAuthStep

func (ui *PTermSetupUI) ExecuteAuthStep(ctx context.Context, wizard *SetupWizard) error

ExecuteAuthStep handles the authentication step.

func (*PTermSetupUI) ExecuteCompletionStep

func (ui *PTermSetupUI) ExecuteCompletionStep(_ *SetupWizard) error

ExecuteCompletionStep offers to set up shell completion.

func (*PTermSetupUI) ExecuteConfigStep

func (ui *PTermSetupUI) ExecuteConfigStep(ctx context.Context, wizard *SetupWizard) error

ExecuteConfigStep handles the configuration step.

func (*PTermSetupUI) ExecuteTutorialStep

func (ui *PTermSetupUI) ExecuteTutorialStep(_ *SetupWizard) error

ExecuteTutorialStep shows the quick tutorial.

func (*PTermSetupUI) ShowCompletion

func (ui *PTermSetupUI) ShowCompletion() error

ShowCompletion displays the completion message.

func (*PTermSetupUI) ShowStepProgress

func (ui *PTermSetupUI) ShowStepProgress(ctx context.Context, current, total int, stepName string) error

ShowStepProgress displays progress for the current step.

func (*PTermSetupUI) ShowStepSkipped

func (ui *PTermSetupUI) ShowStepSkipped(ctx context.Context, stepName string) error

ShowStepSkipped indicates a step was skipped.

func (*PTermSetupUI) ShowWelcome

func (ui *PTermSetupUI) ShowWelcome() error

ShowWelcome displays the welcome screen.

type Pin

type Pin struct {
	CID      string
	Name     string
	Status   string
	Created  string
	Metadata map[string]string
}

Pin represents a pinned item

type PinResult

type PinResult struct {
	CID       string
	RequestID string
	Status    string
}

PinResult represents the result of a pin operation

func NewPinResult

func NewPinResult(cid, requestID, status string) *PinResult

NewPinResult creates a new PinResult with the given details.

type PinStatus

type PinStatus struct {
	CID       string
	Status    string
	Delegates []string
	Created   string
}

PinStatus represents the status of a pin

type PinningService

type PinningService interface {
	// Pin existing content by CID
	Pin(ctx context.Context, cid, name string, wait bool) (*PinResult, error)

	// Pin multiple CIDs in batch
	PinBatch(ctx context.Context, cids []string, name string, opts BatchOptions) (*BatchResult, error)

	// List pinned content with optional filters
	List(ctx context.Context, nameFilter string, limit int, statusFilter string) ([]Pin, error)

	// Get status of a pin
	Status(ctx context.Context, cid string, watch bool) (*PinStatus, error)

	// Remove a pin
	Unpin(ctx context.Context, cid string, confirm bool) (*UnpinResult, error)

	// Unpin multiple CIDs in batch
	UnpinBatch(ctx context.Context, cids []string, opts BatchOptions) (*BatchResult, error)

	// Update metadata for a pin
	UpdateMetadata(ctx context.Context, cid string, set []string, clear bool) error

	// RequireAuthenticated checks if the service is authenticated.
	RequireAuthenticated() error
}

PinningService defines the interface for pinning operations on existing IPFS content.

func NewPinningService

func NewPinningService(cfgMgr config.Manager, output Output, apiEndpoint string, opts ...PinningServiceOption) PinningService

NewPinningService creates a new PinningService with the given dependencies.

type PinningServiceDefault

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

PinningServiceDefault provides pinning operations using the IPFS pinning service API.

func (*PinningServiceDefault) List

func (s *PinningServiceDefault) List(ctx context.Context, nameFilter string, limit int, statusFilter string) ([]Pin, error)

List returns a list of pinned content with optional filters.

func (*PinningServiceDefault) Pin

func (s *PinningServiceDefault) Pin(ctx context.Context, cidStr, name string, wait bool) (*PinResult, error)

Pin pins existing content by CID.

func (*PinningServiceDefault) PinBatch

func (s *PinningServiceDefault) PinBatch(ctx context.Context, cids []string, name string, opts BatchOptions) (*BatchResult, error)

PinBatch pins multiple CIDs in parallel using workerpool.

func (*PinningServiceDefault) RequireAuthenticated

func (s *PinningServiceDefault) RequireAuthenticated() error

RequireAuthenticated checks if the service is authenticated and returns an error if not.

func (*PinningServiceDefault) Status

func (s *PinningServiceDefault) Status(ctx context.Context, cidStr string, watch bool) (*PinStatus, error)

Status returns the status of a pin.

func (*PinningServiceDefault) Unpin

func (s *PinningServiceDefault) Unpin(ctx context.Context, cidStr string, confirm bool) (*UnpinResult, error)

Unpin removes a pin by CID.

func (*PinningServiceDefault) UnpinBatch

func (s *PinningServiceDefault) UnpinBatch(ctx context.Context, cids []string, opts BatchOptions) (*BatchResult, error)

UnpinBatch unpins multiple CIDs in parallel using workerpool.

func (*PinningServiceDefault) UpdateMetadata

func (s *PinningServiceDefault) UpdateMetadata(ctx context.Context, cidStr string, set []string, clear bool) error

UpdateMetadata updates metadata for a pin.

type PinningServiceFactory

type PinningServiceFactory func(cfgMgr config.Manager, output Output) PinningService

PinningServiceFactory creates a PinningService with dependencies

type PinningServiceOption

type PinningServiceOption func(*PinningServiceDefault)

PinningServiceOption configures a PinningService.

func WithAuthToken

func WithAuthToken(token string) PinningServiceOption

WithAuthToken sets an auth token override that takes precedence over config.

func WithPinningClient

func WithPinningClient(client internal.PinningClient) PinningServiceOption

WithPinningClient sets a custom pinning client (useful for testing).

func WithPinningClientFactory

func WithPinningClientFactory(factory internal.PinningClientFactory) PinningServiceOption

WithPinningClientFactory sets a custom client factory for creating pinning clients.

type PowerShellCompletionDetector

type PowerShellCompletionDetector struct{}

PowerShellCompletionDetector checks for PowerShell completion configuration.

func (*PowerShellCompletionDetector) ConfigPath

func (d *PowerShellCompletionDetector) ConfigPath() string

func (*PowerShellCompletionDetector) InstallCommand

func (d *PowerShellCompletionDetector) InstallCommand() string

func (*PowerShellCompletionDetector) IsConfigured

func (d *PowerShellCompletionDetector) IsConfigured() (bool, error)

func (*PowerShellCompletionDetector) Name

type ProgressWriter

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

ProgressWriter wraps an io.Reader to track read progress and display a pterm progress bar.

func NewProgressWriter

func NewProgressWriter(reader io.Reader, total int64, enabled bool, title string) *ProgressWriter

NewProgressWriter creates a new progress writer. If enabled is false, total is 0, or not in a terminal, no progress bar will be displayed.

func (*ProgressWriter) Read

func (pw *ProgressWriter) Read(p []byte) (int, error)

Read implements io.Reader, tracking bytes read and updating progress.

func (*ProgressWriter) Start

func (pw *ProgressWriter) Start() error

Start begins displaying the progress bar.

func (*ProgressWriter) Stop

func (pw *ProgressWriter) Stop() error

Stop ensures the progress bar is stopped.

type QuotaAdminService

type QuotaAdminService interface {
	RequireAuthenticated() error

	// Plan operations
	ListPlans(ctx context.Context) ([]*admin.QuotaPlan, int, error)
	CreatePlan(ctx context.Context, plan *admin.QuotaPlan) (*admin.QuotaPlan, error)
	GetPlan(ctx context.Context, planID string) (*admin.QuotaPlan, error)
	UpdatePlan(ctx context.Context, planID string, plan *admin.QuotaPlan) (*admin.QuotaPlan, error)
	DeletePlan(ctx context.Context, planID string) error
	SetDefaultPlan(ctx context.Context, planID string) error

	// Allowance operations
	ListAllowances(ctx context.Context) ([]*admin.QuotaAllowance, int, error)
	CreateAllowance(ctx context.Context, userID int, source, allowanceType string, upload, download, storage int, expiryDate time.Time) (*admin.QuotaAllowance, error)
	UpdateAllowance(ctx context.Context, grantID string, userID int, source, allowanceType string, upload, download, storage int, expiryDate time.Time) (*admin.QuotaAllowance, error)
	DeleteAllowance(ctx context.Context, grantID string) error

	// System operations
	GetStats(ctx context.Context) (*admin.SystemStats, error)
	Reconcile(ctx context.Context, userID *int) (string, int, error)
	Cleanup(ctx context.Context, retentionDays int) (int, error)

	// User config operations
	ListUserConfigs(ctx context.Context) ([]*admin.UserQuotaConfig, int, error)
	UpdateUserConfig(ctx context.Context, userID int, config *admin.UserQuotaConfigUpdate) (*admin.UserQuotaConfig, error)
	ResetUserPlan(ctx context.Context, userID int) error
}

QuotaAdminService defines the interface for quota admin operations.

func NewQuotaAdminService

func NewQuotaAdminService(cfgMgr config.Manager, output Output, apiEndpoint string) QuotaAdminService

NewQuotaAdminService creates a new QuotaAdminService instance.

type QuotaAdminServiceFactory

type QuotaAdminServiceFactory func(cfgMgr config.Manager, output Output) QuotaAdminService

QuotaAdminServiceFactory creates a QuotaAdminService with dependencies.

type SetupOptions

type SetupOptions struct {
	SkipAuth   bool
	SkipConfig bool
	Reset      bool
}

SetupOptions configures the wizard behavior.

type SetupStep

type SetupStep interface {
	// Name returns the step name.
	Name() string

	// ShouldSkip returns true if the step should be skipped.
	ShouldSkip(wizard *SetupWizard) bool

	// Execute runs the step logic.
	Execute(ctx context.Context, wizard *SetupWizard) error
}

SetupStep represents a single step in the setup process.

type SetupUI

type SetupUI interface {
	// Welcome screen
	ShowWelcome() error

	// Progress tracking
	ShowStepProgress(ctx context.Context, current, total int, stepName string) error
	ShowStepSkipped(ctx context.Context, stepName string) error

	// Completion
	ShowCompletion() error

	// Step execution
	ExecuteAuthStep(ctx context.Context, wizard *SetupWizard) error
	ExecuteConfigStep(ctx context.Context, wizard *SetupWizard) error
	ExecuteCompletionStep(wizard *SetupWizard) error
	ExecuteTutorialStep(wizard *SetupWizard) error
}

SetupUI defines the interface for setup wizard UI interactions. This allows for easy testing by providing mock implementations.

type SetupWizard

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

SetupWizard manages the setup process. This is the business logic layer - fully testable without UI dependencies.

func NewSetupWizard

func NewSetupWizard(
	cfgMgr config.Manager,
	authService AuthService,
	ui SetupUI,
	options SetupOptions,
) *SetupWizard

NewSetupWizard creates a new setup wizard.

func (*SetupWizard) AuthService

func (w *SetupWizard) AuthService() AuthService

AuthService returns the auth service.

func (*SetupWizard) ConfigManager

func (w *SetupWizard) ConfigManager() config.Manager

ConfigManager returns the config manager.

func (*SetupWizard) CurrentStep

func (w *SetupWizard) CurrentStep() int

CurrentStep returns the current step index.

func (*SetupWizard) IsCompleted

func (w *SetupWizard) IsCompleted() bool

IsCompleted returns whether the wizard completed successfully.

func (*SetupWizard) Options

func (w *SetupWizard) Options() SetupOptions

Options returns the setup options.

func (*SetupWizard) Run

func (w *SetupWizard) Run(ctx context.Context) error

Run executes the setup wizard.

type StdinSource

type StdinSource struct{}

StdinSource is a ValueSource that reads from stdin. It implements the urfave/cli ValueSource interface.

func NewStdinSource

func NewStdinSource() *StdinSource

NewStdinSource creates a new StdinSource.

func Stdin

func Stdin() *StdinSource

Stdin is a convenience function to create a StdinSource.

func (*StdinSource) GoString

func (s *StdinSource) GoString() string

GoString returns a Go string representation of the source.

func (*StdinSource) Lookup

func (s *StdinSource) Lookup() (string, bool)

Lookup reads from stdin and returns the value. Returns empty string and false if stdin is empty or not a pipe.

func (*StdinSource) String

func (s *StdinSource) String() string

String returns a string representation of the source.

type TutorialCommand

type TutorialCommand struct {
	*cli.Command
	Metadata *TutorialMetadata
}

TutorialCommand wraps a cli.Command with tutorial metadata.

func TutorialCommands

func TutorialCommands(rootCmd *cli.Command) []TutorialCommand

TutorialCommands returns the list of commands to display in the tutorial, extracted dynamically from the root command's subcommands.

type TutorialMetadata

type TutorialMetadata struct {
	Priority    int    // Order in tutorial (1=first, higher values come later)
	Description string // Brief description for tutorial (uses Description if empty)
	Example     string // Specific usage example (uses Usage if empty)
}

TutorialMetadata contains information for displaying a command in the tutorial.

type TutorialStep

type TutorialStep struct{}

TutorialStep shows quick tutorial.

func (*TutorialStep) Execute

func (s *TutorialStep) Execute(ctx context.Context, wizard *SetupWizard) error

func (*TutorialStep) Name

func (s *TutorialStep) Name() string

func (*TutorialStep) ShouldSkip

func (s *TutorialStep) ShouldSkip(wizard *SetupWizard) bool

type UnpinResult

type UnpinResult struct {
	CID string
}

UnpinResult represents the result of an unpin operation

func NewUnpinResult

func NewUnpinResult(cid string) *UnpinResult

NewUnpinResult creates a new UnpinResult with the given CID.

type UploadInput

type UploadInput struct {
	Filesystem fs.FS
	Name       string
	// contains filtered or unexported fields
}

UploadInput represents the resolved input source for an upload operation.

func (*UploadInput) Close

func (i *UploadInput) Close() error

Close releases resources held by the UploadInput, such as open file handles.

type UploadResult

type UploadResult struct {
	CID      string
	Size     int64
	Duration time.Duration
}

UploadResult contains information about an upload operation.

type UploadService

type UploadService interface {
	// Upload file/directory to IPFS.
	// Returns the upload result with CID, size, and duration.
	Upload(ctx context.Context, filesystem fs.FS, name string, wait bool) (*UploadResult, error)
}

UploadService defines the interface for uploading content to IPFS.

func NewUploadService

func NewUploadService(cfgMgr config.Manager, output Output, apiEndpoint string, opts ...UploadServiceOption) UploadService

NewUploadService creates a new UploadService with the given dependencies.

type UploadServiceConfig

type UploadServiceConfig struct {
	HTTPClient    *http.Client
	AccountClient portalsdk.AccountAPI
}

UploadServiceConfig holds configuration options for UploadService.

type UploadServiceDefault

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

UploadServiceDefault provides upload operations using the Pinner.xyz API.

func (*UploadServiceDefault) RequireAuthenticated

func (s *UploadServiceDefault) RequireAuthenticated() error

RequireAuthenticated checks if the service is authenticated and returns an error if not.

func (*UploadServiceDefault) Upload

func (s *UploadServiceDefault) Upload(ctx context.Context, filesystem fs.FS, name string, wait bool) (*UploadResult, error)

Upload uploads a file or directory to IPFS and optionally pins it.

func (*UploadServiceDefault) WithAuthToken

func (s *UploadServiceDefault) WithAuthToken(token string) *UploadServiceDefault

WithAuthToken sets an auth token override that takes precedence over config.

type UploadServiceFactory

type UploadServiceFactory func(cfgMgr config.Manager, output Output, opts ...UploadServiceOption) UploadService

UploadServiceFactory creates an UploadService with dependencies

type UploadServiceOption

type UploadServiceOption func(*UploadServiceDefault)

UploadServiceOption is a function that configures an UploadService.

func WithMemoryLimit

func WithMemoryLimit(limit uint64) UploadServiceOption

WithMemoryLimit sets a memory limit override that takes precedence over config.

func WithUploadAccountClient

func WithUploadAccountClient(client portalsdk.AccountAPI) UploadServiceOption

WithUploadAccountClient sets a custom account client for the upload service. This is primarily used for testing to inject mock clients.

func WithUploadHTTPClient

func WithUploadHTTPClient(client *http.Client) UploadServiceOption

WithUploadHTTPClient sets a custom HTTP client for the service. This is primarily used for testing to inject mock HTTP clients.

type WebsitesService

type WebsitesService interface {
	RequireAuthenticated() error
	List(ctx context.Context) ([]ipfs.WebsiteItem, error)
	Create(ctx context.Context, domain, targetHash, targetType string) (*ipfs.WebsiteItem, error)
	Get(ctx context.Context, id string) (*ipfs.WebsiteItem, error)
	Update(ctx context.Context, id, domain, targetHash, targetType string) (*ipfs.WebsiteItem, error)
	Delete(ctx context.Context, id string) error
	Validate(ctx context.Context, id string) (*ipfs.WebsiteValidateResponse, error)
	GetSSLStatus(ctx context.Context, domain string) (*ipfs.WebsiteResponse, error)
}

WebsitesService defines the interface for website operations.

func NewWebsitesService

func NewWebsitesService(cfgMgr config.Manager, output Output, apiEndpoint string) WebsitesService

NewWebsitesService creates a new WebsitesService instance.

type WebsitesServiceFactory

type WebsitesServiceFactory func(cfgMgr config.Manager, output Output) WebsitesService

WebsitesServiceFactory creates a WebsitesService with dependencies.

type ZshCompletionDetector

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

ZshCompletionDetector checks for zsh completion configuration.

func (*ZshCompletionDetector) ConfigPath

func (d *ZshCompletionDetector) ConfigPath() string

func (*ZshCompletionDetector) InstallCommand

func (d *ZshCompletionDetector) InstallCommand() string

func (*ZshCompletionDetector) IsConfigured

func (d *ZshCompletionDetector) IsConfigured() (bool, error)

func (*ZshCompletionDetector) Name

func (d *ZshCompletionDetector) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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