demonapi

package
v0.0.0-...-0b74930 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeList = "List"
	ModeGet  = "Get"
	ModePut  = "Put"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Clerk

type Clerk struct {
	Client http.Client
	Config ClerkConfig
}

func (*Clerk) Authenticate

func (c *Clerk) Authenticate(mode, key, checksum string) (string, http.Header, string, error)

func (*Clerk) DeviceName

func (c *Clerk) DeviceName() (string, error)

func (*Clerk) GetObject

func (c *Clerk) GetObject(path string) ([]byte, error)

func (*Clerk) GetObjectStream

func (c *Clerk) GetObjectStream(path string) (io.ReadCloser, error)

func (*Clerk) ListObjectsV2

func (c *Clerk) ListObjectsV2() (*s3.ListObjectsV2Output, error)

func (*Clerk) PutObject

func (c *Clerk) PutObject(pathInfix string, data []byte) (string, error)

PutObject returns the created filename.

func (*Clerk) PutObjectStream

func (c *Clerk) PutObjectStream(pathInfix string, data io.ReadSeeker) (string, error)

Note: this WILL seek the stream to position 0 before beginning

type ClerkConfig

type ClerkConfig struct {
	URL         string `json:"url"`
	SpacePrefix string `json:"prefix"`
	DeviceName  string `json:"device"`
	DeviceToken string `json:"token"`
}

Jump to

Keyboard shortcuts

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