dto

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package dto provides data transfer objects for the ephemeralfiles API. These structures define the request and response formats used in API communications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Err        bool   `json:"-"` // Not directly unmarshaled
	Message    string `json:"message"`
	LegacyMsg  string `json:"msg"`
	ErrorField any    `json:"error"` // Can be bool or string
}

APIError is the error response from the API. The API can return error in two formats: 1. {"error": true, "msg": "error message"} (legacy format). 2. {"error": "error message", "message": "error message"} (new format).

func (*APIError) GetMessage added in v0.3.0

func (e *APIError) GetMessage() string

GetMessage returns the error message from either format.

type File

type File struct {
	FileID          string    `json:"file_id"`
	OwnerID         string    `json:"owner_id"`
	FileName        string    `json:"filename"`
	Size            int64     `json:"size"`
	UpdateDateBegin time.Time `json:"update_date_begin"`
	UpdateDateEnd   time.Time `json:"update_date_end"`
	ExpirationDate  time.Time `json:"expiration_date"`
}

File is the struct that represents a file in the API.

type FileList

type FileList []File

FileList is a list of files.

type InfoFile

type InfoFile struct {
	Filename string `json:"filename"`
	Size     int64  `json:"size"`
	NbParts  int    `json:"nb_parts"`
}

InfoFile contains information about a file to be uploaded.

type Organization added in v0.3.0

type Organization struct {
	ID                   string  `json:"id"`
	Name                 string  `json:"name"`
	DefaultRetentionDays int32   `json:"default_retention_days"`
	CreatedAt            string  `json:"created_at"`
	UpdatedAt            string  `json:"updated_at"`
	SubscriptionActive   bool    `json:"subscription_active"`
	UserRole             string  `json:"user_role,omitempty"`
	StorageLimitGB       float64 `json:"storage_limit_gb"`
	UsedStorageGB        float64 `json:"used_storage_gb"`
}

Organization represents an organization entity.

type OrganizationFile added in v0.3.0

type OrganizationFile struct {
	ID              string   `json:"id"`
	Filename        string   `json:"filename"`
	Size            int64    `json:"size"`
	OrganizationID  string   `json:"organization_id"`
	Tags            []string `json:"tags,omitempty"`
	UploadDateBegin string   `json:"upload_date_begin"`
	UploadDateEnd   string   `json:"upload_date_end,omitempty"`
	ExpirationDate  string   `json:"expiration_date"`
	OwnerID         string   `json:"owner_id"`
	OwnerEmail      string   `json:"owner_email,omitempty"`
}

OrganizationFile represents a file in an organization.

type OrganizationStats added in v0.3.0

type OrganizationStats struct {
	OrganizationID string  `json:"organization_id"`
	FileCount      int64   `json:"file_count"`
	TotalSizeGB    float64 `json:"total_size_gb"`
	MemberCount    int64   `json:"member_count"`
	ActiveFiles    int64   `json:"active_files"`
	ExpiredFiles   int64   `json:"expired_files"`
}

OrganizationStats represents organization statistics.

type OrganizationStorage added in v0.3.0

type OrganizationStorage struct {
	ID             string  `json:"id"`
	Name           string  `json:"name"`
	StorageLimitGB float64 `json:"storage_limit_gb"`
	UsedStorageGB  float64 `json:"used_storage_gb"`
	UsagePercent   float64 `json:"usage_percent"`
	IsFull         bool    `json:"is_full"`
}

OrganizationStorage represents storage information for an organization.

type RequestAESKey

type RequestAESKey struct {
	AESKey string `json:"aeskey"`
}

RequestAESKey contains the AES encryption key for E2E encrypted operations.

type TagCount added in v0.3.0

type TagCount struct {
	Tag   string `json:"tag"`
	Count int64  `json:"count"`
}

TagCount represents a tag with its usage count.

Jump to

Keyboard shortcuts

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