Documentation
¶
Index ¶
- func Authenticate(client client.HTTPClient, login, password string) ([]*http.Cookie, error)
- func ChangeLabels(client client.HTTPClient, module *module.Module, cookies []*http.Cookie, ...) error
- func UploadZIP(ctx context.Context, client client.HTTPClient, module *module.Module, ...) error
- func Versions(ctx context.Context, client client.HTTPClient, module *module.Module, ...) (types.Versions, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶ added in v1.5.2
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 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).
Types ¶
This section is empty.