static

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package static contains utility to work with ThundeRatz static files server https://static.thunderatz.org/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	BasePath string
	// contains filtered or unexported fields
}

Conn represents a connection to the static server

func New

func New(addr, user, password, base string, port int) (*Conn, error)

New initializes a new connection to the static server

func (*Conn) Close

func (sc *Conn) Close()

Close ends the connection to the static server

func (*Conn) Get

func (sc *Conn) Get(remote string) error

Get downloads a file from the remote path, relative to the static base path

func (*Conn) List

func (sc *Conn) List(path string) ([]os.FileInfo, error)

List returns a list of files form path realtive to static base path

func (*Conn) Mkdir

func (sc *Conn) Mkdir(path string, makeParents bool) error

Mkdir creates the directory in the remote path, relative to static base path

func (*Conn) Put

func (sc *Conn) Put(local, remote string, overwrite bool) error

Put uploads a file to the remote path, relative to the static base path

Jump to

Keyboard shortcuts

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