services

package
v0.0.0-...-a1f4ec6 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3Object

type S3Object struct {
	Bucket     string    `json:"bucket"`
	Name       string    `json:"name"`
	Date       time.Time `json:"date"`
	PrettyDate string    `json:"pretty_date"`
	Size       int64     `json:"size"`
	Tag        string    `json:"tag"`
	Age        string    `json:"age"`
	// contains filtered or unexported fields
}

S3Object holds important information from an s3 key

func (S3Object) String

func (s S3Object) String() string

func (*S3Object) UploadFromReader

func (s *S3Object) UploadFromReader(reader io.Reader) error

UploadFromReader uploads to bucket from io reader

type Service

type Service struct {
	Sess   *session.Session
	Bucket string
	Prefix string
	// contains filtered or unexported fields
}

Service for aws bucket

func New

func New(ctx context.Context) *Service

New aws services

func (*Service) AWSConnect

func (s *Service) AWSConnect() error

AWSConnect establishes aws connection

func (*Service) DownloadImages

func (s *Service) DownloadImages(keyName string) (image.Image, string, error)

DownloadImages downloads images from bucket

func (*Service) List

func (s *Service) List(prefix *string) ([]*S3Object, error)

List lists the s3 objects at a bucket and prefix

func (*Service) NewS3FromObj

func (s *Service) NewS3FromObj(obj *s3.Object) *S3Object

NewS3FromObj creates a new s3 object

func (*Service) NewS3Object

func (s *Service) NewS3Object(keyName string) *S3Object

NewS3Object from key

Jump to

Keyboard shortcuts

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