api

package
v0.0.0-...-d19f603 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDigestHeader

func BuildDigestHeader(method string, uri string, realm string, nonce string, username string, password string) (string, error)

func DeleteFile

func DeleteFile(file string, host string, username string, password string) error

func GenericDelete

func GenericDelete(host string, path string, username string, password string) error

func GenericGet

func GenericGet[Res any](host string, path string, username string, password string) (*Res, error)

func Md5Hash

func Md5Hash(s string) string

func Perform

func Perform(client *http.Client, req *http.Request, username string, password string) (*http.Response, error)

Types

type DigestResponse

type DigestResponse struct {
	Realm string
	Nonce string
	Stale bool
}

func ParseDigestResponse

func ParseDigestResponse(s string) (*DigestResponse, error)

type FileItemResponse

type FileItemResponse struct {
	Name              string `json:"name"`
	ReadOnly          bool   `json:"ro"`
	Type              string `json:"type"`
	DisplayName       string `json:"display_name"`
	ModifiedTimestamp int64  `json:"m_timestamp"`
}

type FilesResponse

type FilesResponse struct {
	Type     string             `json:"type"`
	ReadOnly bool               `json:"ro"`
	Name     string             `json:"name"`
	Children []FileItemResponse `json:"children"`
}

func GetFiles

func GetFiles(storage string, host string, username string, password string) (*FilesResponse, error)

type JobFileResponse

type JobFileResponse struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
}

type JobResponse

type JobResponse struct {
	ID            int             `json:"id"`
	State         string          `json:"state"`
	Progress      float64         `json:"progress"`
	TimeRemaining int             `json:"time_remaining"`
	TimePrinting  int             `json:"time_printing"`
	File          JobFileResponse `json:"file"`
}

func GetJob

func GetJob(host string, username string, password string) (*JobResponse, error)

type StatusJobResponse

type StatusJobResponse struct {
	ID            int     `json:"id"`
	Progress      float64 `json:"progress"`
	TimeRemaining int     `json:"time_remaining"`
	TimePrinting  int     `json:"time_printing"`
}

type StatusPrinterResponse

type StatusPrinterResponse struct {
	State string `json:"state"`
}

type StatusResponse

type StatusResponse struct {
	Job     StatusJobResponse     `json:"job"`
	Printer StatusPrinterResponse `json:"printer"`
}

func GetStatus

func GetStatus(host string, username string, password string) (*StatusResponse, error)

type StorageInfoResponse

type StorageInfoResponse struct {
	Name      string `json:"name"`
	Type      string `json:"type"`
	Path      string `json:"path"`
	Available bool   `json:"available"`
	ReadOnly  bool   `json:"read_only"`
}

type StorageResponse

type StorageResponse struct {
	StorageList []StorageInfoResponse `json:"storage_list"`
}

func GetStorage

func GetStorage(host string, username string, password string) (*StorageResponse, error)

Jump to

Keyboard shortcuts

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