cmd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(ctx *cli.Context) error

func List

func List(ctx *cli.Context) error

Types

type Client

type Client struct {
	http.Client
	APIEndpoint    string
	RequestHeaders map[string]string
	Concurrency    int
}

func NewClient

func NewClient(apiEndpoint, bearerToken, userAgent string, concurrency int) *Client

func NewClientFromCLIContext

func NewClientFromCLIContext(ctx *cli.Context) *Client

func (*Client) DownloadMedia

func (c *Client) DownloadMedia(m *Media, localPath string) (err error)

func (*Client) ListMedias

func (c *Client) ListMedias(from, to *time.Time) (medias []*Media, err error)

type DefaultResponse

type DefaultResponse struct {
	Pages struct {
		CurrentPage int64 `json:"current_page"`
		PerPage     int64 `json:"per_page"`
		TotalItems  int64 `json:"total_items"`
		TotalPages  int64 `json:"total_pages"`
	} `json:"_pages"`
}

type Media

type Media struct {
	ID         string    `json:"id"`
	CapturedAt time.Time `json:"captured_at"`
	Filename   string    `json:"filename"`
	Type       MediaType `json:"type"`
	Resolution string    `json:"resolution"`
}

func (*Media) String

func (m *Media) String() string

type MediaType

type MediaType string
const (
	MediaTypeVideo MediaType = "Video"
	MediaTypePhoto MediaType = "Photo"
)

Jump to

Keyboard shortcuts

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