Documentation ¶
Index ¶
- Constants
- func GenericError(err error) error
- func HandleError(err error) error
- func HttpClient() *http.Client
- func ProxmoxError(err error) error
- func WithHttpCredentials(r *http.Request) (*http.Request, error)
- func WriteSubjectToCache(subject *ProxmoxSubject) error
- type CommandError
- type ExitCodeAwareError
- type ProxmoxSubject
Constants ¶
View Source
const ( GenericErrorExitCode = 1 ProxmoxErrorExitCode = 2 ValidationErrorExitCode = 3 )
View Source
const ( ProxmoxCSRFTokenHeader = "CSRFPreventionToken" ProxmoxTicketCookieName = "PVEAuthCookie" )
View Source
const (
TicketCache = ".proxmox"
)
Variables ¶
This section is empty.
Functions ¶
func GenericError ¶
func HandleError ¶
func HttpClient ¶
Returns an http client. TODO: support secure transport
func ProxmoxError ¶
func WriteSubjectToCache ¶
func WriteSubjectToCache(subject *ProxmoxSubject) error
Write session information to ticket cache in (pretty) JSON format.
Types ¶
type CommandError ¶
func (*CommandError) Error ¶
func (e *CommandError) Error() string
func (*CommandError) ExitCode ¶
func (e *CommandError) ExitCode() int
type ExitCodeAwareError ¶
type ProxmoxSubject ¶
type ProxmoxSubject struct { Username string `json:"username"` Ticket string `json:"ticket"` CSRFToken string `json:"csrf_token"` ApiServer string `json:"api_server"` }
Session information representing an authenticated Proxmox user
func ReadSubjectFromCache ¶
func ReadSubjectFromCache() (*ProxmoxSubject, error)
Read session subject from ticket cache
Click to show internal directories.
Click to hide internal directories.