// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================

package service

import (
	"context"
	"kami/internal/model"
	"time"
)

type (
	IProxyPool interface {
		InitStrategy(ctx context.Context, apiURL string, ttl time.Duration) error
		InitActiveExpireStrategy(ctx context.Context, apiURL string, ttl time.Duration, refreshThreshold time.Duration) error
		GetProxyByOrderId(ctx context.Context, orderId string) (*model.ProxyInfo, error)
		SetProxyForOrder(ctx context.Context, orderId string, proxy *model.ProxyInfo) error
		RemoveProxyForOrder(ctx context.Context, orderId string) error
		GetProxyTTL(ctx context.Context, orderId string) (time.Duration, error)
		SwitchStrategy(strategy model.IProxyPoolStrategy)
	}
)

var (
	localProxyPool IProxyPool
)

func ProxyPool() IProxyPool {
	if localProxyPool == nil {
		panic("implement not found for interface IProxyPool, forgot register?")
	}
	return localProxyPool
}

func RegisterProxyPool(i IProxyPool) {
	localProxyPool = i
}
