client

package
v0.0.0-...-13add4e Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	Commit    string `json:"commit"`
	BuildTime string `json:"build_time"`
	GoVersion string `json:"go_version"`
}

type Client

type Client struct {
	BaseURL    string
	APIVersion string
	// contains filtered or unexported fields
}

Client represents a Synkronus API client

func NewClient

func NewClient() *Client

NewClient creates a new Synkronus API client

func (*Client) AdminRepositoryReset

func (c *Client) AdminRepositoryReset() (*generated.RepositoryResetResponse, error)

AdminRepositoryReset performs an irreversible server-side wipe of observation and attachment sync data (admin JWT).

func (*Client) AttachmentExists

func (c *Client) AttachmentExists(attachmentID string) (bool, error)

AttachmentExists checks if an attachment exists on the server

func (*Client) ChangeOwnPassword

func (c *Client) ChangeOwnPassword(reqBody UserChangePasswordRequest) error

ChangeOwnPassword calls POST /users/change-password (self)

func (*Client) CreateUser

func (c *Client) CreateUser(reqBody UserCreateRequest) (map[string]interface{}, error)

CreateUser calls POST /users to create a new user (admin)

func (*Client) DeleteUser

func (c *Client) DeleteUser(username string) error

DeleteUser calls DELETE /users/delete/{username} (admin)

func (*Client) DownloadAppBundleFile

func (c *Client) DownloadAppBundleFile(path, destPath string, preview bool) error

DownloadAppBundleFile downloads a specific file from the app bundle If preview is true, adds ?preview=true to the request URL

func (*Client) DownloadAttachment

func (c *Client) DownloadAttachment(attachmentID string, outputPath string) error

DownloadAttachment downloads an attachment from the server

func (*Client) DownloadAttachmentsExport

func (c *Client) DownloadAttachmentsExport(destPath string) error

DownloadAttachmentsExport downloads a ZIP of all current attachments to the specified destination path

func (*Client) DownloadParquetExport

func (c *Client) DownloadParquetExport(destPath string) error

DownloadParquetExport downloads the Parquet export ZIP archive to the specified destination path

func (*Client) DownloadRawJSONExport

func (c *Client) DownloadRawJSONExport(destPath string) error

DownloadRawJSONExport downloads the per-observation JSON ZIP export to the specified destination path

func (*Client) GetAppBundleManifest

func (c *Client) GetAppBundleManifest() (map[string]interface{}, error)

GetAppBundleManifest retrieves the app bundle manifest

func (*Client) GetAppBundleVersions

func (c *Client) GetAppBundleVersions() (map[string]interface{}, error)

GetAppBundleVersions retrieves available app bundle versions

func (*Client) GetVersion

func (c *Client) GetVersion() (*SystemVersionInfo, error)

GetVersion retrieves version information from the Synkronus server

func (*Client) ListUsers

func (c *Client) ListUsers() ([]generated.UserListItem, error)

ListUsers calls GET /api/users (admin only).

func (*Client) ResetUserPassword

func (c *Client) ResetUserPassword(reqBody UserResetPasswordRequest) error

ResetUserPassword calls POST /users/reset-password (admin)

func (*Client) SwitchAppBundleVersion

func (c *Client) SwitchAppBundleVersion(version string) (map[string]interface{}, error)

SwitchAppBundleVersion switches to a specific app bundle version

func (*Client) SyncPull

func (c *Client) SyncPull(clientID string, currentVersion int64, schemaTypes []string, limit int, pageToken string, repositoryGeneration *int64) (map[string]interface{}, error)

SyncPull pulls updated records from the server

func (*Client) SyncPush

func (c *Client) SyncPush(clientID string, transmissionID string, records []map[string]interface{}, repositoryGeneration *int64) (map[string]interface{}, error)

SyncPush pushes records to the server

func (*Client) UploadAppBundle

func (c *Client) UploadAppBundle(bundlePath string) (map[string]interface{}, error)

UploadAppBundle uploads a new app bundle

func (*Client) UploadAttachment

func (c *Client) UploadAttachment(attachmentID string, filePath string) (map[string]interface{}, error)

UploadAttachment uploads a file to the server with the specified attachment ID

type DatabaseInfo

type DatabaseInfo struct {
	Type         string `json:"type"`
	Version      string `json:"version"`
	DatabaseName string `json:"database_name"`
}

type ServerInfo

type ServerInfo struct {
	Version string `json:"version"`
}

type SystemInfo

type SystemInfo struct {
	OS           string `json:"os"`
	Architecture string `json:"architecture"`
	CPUs         int    `json:"cpus"`
}

type SystemVersionInfo

type SystemVersionInfo struct {
	Server   ServerInfo   `json:"server"`
	Database DatabaseInfo `json:"database"`
	System   SystemInfo   `json:"system"`
	Build    BuildInfo    `json:"build"`
}

SystemVersionInfo represents the version information of the Synkronus server

type UserChangePasswordRequest

type UserChangePasswordRequest struct {
	OldPassword string `json:"oldPassword"`
	NewPassword string `json:"newPassword"`
}

UserChangePasswordRequest represents the payload for changing own password

type UserCreateRequest

type UserCreateRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Role     string `json:"role"`
}

UserCreateRequest represents the payload for creating a user

type UserResetPasswordRequest

type UserResetPasswordRequest struct {
	Username    string `json:"username"`
	NewPassword string `json:"newPassword"`
}

UserResetPasswordRequest represents the payload for resetting a user's password

Directories

Path Synopsis
Package generated provides primitives to interact with the openapi HTTP API.
Package generated provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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