structs

package
v0.0.0-...-c345ff7 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HexSHA256Hash

func HexSHA256Hash(b []byte) string

func HmacSHA256

func HmacSHA256(key []byte, data []byte) []byte

Types

type App

type App struct {
	Addr      *string
	Router    *http.ServeMux
	AccessKey *string
	SecretKey *string
	Mount     *string
	Metadata  *string
}

func (*App) ParseRequest

func (app *App) ParseRequest(r *http.Request) (*Request, error)

func (*App) Respond

func (app *App) Respond(w http.ResponseWriter, code int, headers map[string]string, body []byte) error

func (*App) RespondError

func (app *App) RespondError(w http.ResponseWriter, httpcode int, awscode string, err error, resource string) error

func (*App) RespondFile

func (app *App) RespondFile(w http.ResponseWriter, code int, headers map[string]string, file *os.File) error

func (*App) RespondXML

func (app *App) RespondXML(w http.ResponseWriter, code int, payload any) error

func (*App) ValidSignatureV4

func (app *App) ValidSignatureV4(r *http.Request) (bool, *http.Request)

type Auth

type Auth struct {
	*App
	R map[string]any
}

func (Auth) ServeHTTP

func (a Auth) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Bucket

type Bucket struct {
	Name         string    `xml:"Name"`
	CreationDate time.Time `xml:"CreationDate"`
}

type CommonPrefix

type CommonPrefix struct {
	Prefix string
}

type CopyObjectResponse

type CopyObjectResponse struct {
	XMLName      xml.Name `xml:"CopyObjectResponse"`
	LastModified string
	ETag         string
}

type Delete

type Delete struct {
	Objects []Object `xml:"Object"`
	Quiet   bool
}

type DeleteError

type DeleteError struct {
	Code      string
	Message   string
	Key       string
	VersionID string `xml:"VersionId"`
}

type DeleteObjectsResponse

type DeleteObjectsResponse struct {
	XMLName        xml.Name        `xml:"DeleteObjectsResponse"`
	DeletedObjects []DeletedObject `xml:"Deleted,omitempty"`
	Errors         []DeleteError   `xml:"Error,omitempty"`
}

type DeletedObject

type DeletedObject struct {
	DeleteMarker          bool   `xml:"DeleteMarker,omitempty"`
	DeleteMarkerVersionID string `xml:"DeleteMarkerVersionId,omitempty"`
	Key                   string `xml:"Key,omitempty"`
	VersionID             string `xml:"VersionId,omitempty"`
}

type Error

type Error struct {
	XMLName   xml.Name `xml:"Error"`
	Code      string   `xml:"Code"`
	Message   string   `xml:"Message"`
	Resource  string   `xml:"Resource"`
	RequestId string   `xml:"RequestId"`
}

type InitiateMultipartUploadResponse

type InitiateMultipartUploadResponse struct {
	XMLName  xml.Name `xml:"InitiateMultipartUploadResponse"`
	Bucket   string
	Key      string
	UploadID string `xml:"UploadId"`
}

type ListAllMyBucketsResult

type ListAllMyBucketsResult struct {
	XMLName xml.Name `xml:"ListAllMyBucketsResult"`
	Xmlns   string   `xml:"xmlns,attr"`
	Buckets []Bucket `xml:"Buckets>Bucket"`
	Owner   *Owner   `xml:"Owner,omitempty"`
}

type ListBucketResult

type ListBucketResult struct {
	XMLName        xml.Name `xml:"ListBucketResult"`
	Name           string
	Prefix         string
	KeyCount       int
	MaxKeys        int
	Delimiter      string `xml:"Delimiter,omitempty"`
	IsTruncated    bool
	Contents       []Object
	CommonPrefixes []CommonPrefix
	EncodingType   string `xml:"EncodingType,omitempty"`
}

type ListVersionsResult

type ListVersionsResult struct {
	XMLName             xml.Name `xml:"ListVersionsResult"`
	Name                string
	Prefix              string
	KeyMarker           string
	NextKeyMarker       string `xml:"NextKeyMarker,omitempty"`
	NextVersionIDMarker string `xml:"NextVersionIdMarker"`
	VersionIDMarker     string `xml:"VersionIdMarker"`
	MaxKeys             int
	Delimiter           string `xml:"Delimiter,omitempty"`
	IsTruncated         bool
	CommonPrefixes      []CommonPrefix
	Version             []ObjectVersion
	EncodingType        string `xml:"EncodingType,omitempty"`
}

type Metadata

type Metadata struct {
	Items []struct {
		Key   string
		Value string
	}
}

type Object

type Object struct {
	Key          string
	LastModified string
	ETag         string
	Size         int64
	Owner        *Owner `xml:"Owner,omitempty"`
	StorageClass string
}

type ObjectVersion

type ObjectVersion struct {
	Object
	IsLatest  bool
	VersionID string `xml:"VersionId"`
	// contains filtered or unexported fields
}

type Owner

type Owner struct {
	ID          string `xml:"ID"`
	DisplayName string `xml:"DisplayName"`
}

type Request

type Request struct {
	Bucket string
	Key    string
	Path   string
}

type VersioningConfiguration

type VersioningConfiguration struct {
	XMLName xml.Name `xml:"VersioningConfiguration"`
	Status  string   `xml:"Status"`
}

Jump to

Keyboard shortcuts

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