Documentation
¶
Overview ¶
Package helpers provides a simple API client for making HTTP requests.
Index ¶
- func CopyFile(src, dst string) error
- func HandleControllerApi(result bool, statusCode string, message string, controllerFunction string, ...) ([]byte, error)
- func HandleControllerGeneric(message string, controllerFunction string, data interface{}, err error) ([]byte, error)
- func LoadConfig()
- func ReplaceInFile(filePath, oldValue, newValue string) error
- func ReturnCompleteDockerRepoPath(repoUrl string, dockerRepo string) string
- func UpdateImageTagWithRegex(filePath, newTag string) error
- type ApiClient
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleControllerApi ¶
func HandleControllerGeneric ¶
func HandleControllerGeneric(message string, controllerFunction string, data interface{}, err error) ([]byte, error)
It has used to manage the response of the controller function if response return values instead of an api response
func LoadConfig ¶
func LoadConfig()
func ReplaceInFile ¶
func UpdateImageTagWithRegex ¶
Types ¶
type ApiClient ¶
type ApiClient struct {
BaseURL string
AuthType string // "Bearer", "Basic", or "None"
AuthToken string
HTTPClient *http.Client
}
APIClient handles HTTP requests with support for different authentication methods.
func NewApiClient ¶
NewApiClient creates a new API client with default settings. Accepts an optional timeout parameter; defaults to 60 seconds if not provided.
type Config ¶
type Config struct {
SINALOA_DEBUG bool
ARGOCD_URL string
ARGOCD_USER string
ARGOCD_PASSWORD string
AZURE_TENANT_ID string
AZURE_CLIENT_ID string
AZURE_CLIENT_SECRET string
AZURE_DRIVE_ID string
DOCKER_HUB_USER_RWD string
DOCKER_HUB_PWD_RWD string
GITHUB_TOKEN string
}
var (
AppConfig Config
)
Click to show internal directories.
Click to hide internal directories.