client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCheckInRequest

func BuildCheckInRequest(fileUUID, csvPath string) (*models.CheckInRequest, error)

func BuildCheckInRequestWithOverrides added in v0.1.3

func BuildCheckInRequestWithOverrides(fileUUID, csvPath string, overrides *models.CheckInOverrides) (*models.CheckInRequest, error)

BuildCheckInRequestWithOverrides builds the check-in request using optional overrides.

func FetchGroups added in v0.2.0

func FetchGroups(ctx context.Context, baseURL, accessToken string, httpClient *http.Client) (*models.GroupsResponse, error)

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
	Method     string
	URL        string
}

func (*APIError) Error

func (e *APIError) Error() string

type ActionPayload

type ActionPayload struct {
	UserInputID string                 `json:"userInputId,omitempty"`
	FileIDs     []string               `json:"fileIds,omitempty"`
	Payload     map[string]interface{} `json:"payload"`
}

type ActionResponse

type ActionResponse struct {
	ActionID string                 `json:"actionId"`
	Payload  map[string]interface{} `json:"payload"`
}

type ActionStatusResponse

type ActionStatusResponse struct {
	ActionID string                 `json:"actionId"`
	Payload  map[string]interface{} `json:"payload"`
}

type Analysis added in v0.1.3

type Analysis struct {
	Delimiter  string
	Header     []string
	DateColumn string
	DateFormat string
	ValueCols  []string
	GroupCols  []string
}

Analysis describes detected CSV structure.

func AnalyzeCSV added in v0.1.3

func AnalyzeCSV(csvPath string) (*Analysis, error)

AnalyzeCSV reports detected columns and delimiter without building a request.

type AuthClient

type AuthClient struct {
	// contains filtered or unexported fields
}

func NewAuthClient

func NewAuthClient(authURL string, httpClient *http.Client) *AuthClient

func (*AuthClient) Authenticate

func (a *AuthClient) Authenticate(username, password, totp string) (*models.TokenResponse, error)

func (*AuthClient) RefreshToken

func (a *AuthClient) RefreshToken(refreshToken string) (*models.TokenResponse, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(
	baseURL, group string,
	cfg *config.Config,
	cfgManager *config.Manager,
	authClient *AuthClient,
	httpClient *http.Client,
) *Client

func (*Client) CheckIn

func (c *Client) CheckIn(
	ctx context.Context,
	userInputID, fileID string,
	req *models.CheckInRequest,
) (string, error)

func (*Client) DeleteReport

func (c *Client) DeleteReport(ctx context.Context, reportID int) error

func (*Client) DeleteUpload

func (c *Client) DeleteUpload(ctx context.Context, userInputID string) error

func (*Client) EnsureValidToken

func (c *Client) EnsureValidToken(ctx context.Context) error

func (*Client) ExecuteAction

func (c *Client) ExecuteAction(
	ctx context.Context,
	coreID string,
	payload *ActionPayload,
	pollInterval time.Duration,
	timeout time.Duration,
) (map[string]interface{}, error)

func (*Client) GetResults

func (c *Client) GetResults(
	ctx context.Context,
	reportID int,
	opts *models.ResultsOptions,
) ([]byte, error)

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context, reportID int) (*models.StatusResponse, error)

func (*Client) StartForecast

func (c *Client) StartForecast(
	ctx context.Context,
	versionID string,
	req *models.ForecastRequest,
) (int, error)

func (*Client) UploadCSV

func (c *Client) UploadCSV(ctx context.Context, filePath string) (*UploadResult, error)

type UploadResult

type UploadResult struct {
	UserInputID string
	FileID      string
}

Jump to

Keyboard shortcuts

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