request

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate added in v1.5.2

func Authenticate(client client.HTTPClient, login, password string) ([]*http.Cookie, error)

Authenticate performs user authentication by sending login credentials to the Bitrix Partner Portal.

It sends a POST request with the login and password as form data and checks the response for authentication success by verifying the presence of a "BITRIX_SM_LOGIN" cookie.

Returns a slice of cookies if authentication is successful or an error if authentication fails or an issue occurs during the request.

func ChangeLabels added in v1.5.2

func ChangeLabels(
	client client.HTTPClient,
	module *module.Module,
	cookies []*http.Cookie,
	versions types.Versions,
) error

func UploadZIP added in v1.5.2

func UploadZIP(
	ctx context.Context,
	client client.HTTPClient,
	module *module.Module,
	cookies []*http.Cookie,
) error

UploadZIP uploads a ZIP file containing the module's data to the Bitrix Partner Portal.

This function first validates that the module and cookies are provided. It then retrieves the session ID and prepares the ZIP file for upload. The request is sent with the necessary form data, including the session ID, module name, and the ZIP file. The response body is checked for the result of the upload operation.

Parameters:

  • ctx: context.Context.
  • module: The module whose ZIP file is being uploaded.
  • cookies: The cookies containing the authentication information.

Returns:

  • An error if any step fails (e.g., missing session, file errors, upload failure).

func Versions added in v1.5.2

func Versions(
	ctx context.Context,
	client client.HTTPClient,
	module *module.Module,
	cookies []*http.Cookie,
) (types.Versions, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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