s3

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileWithLogger added in v1.0.20

func FileWithLogger(logger *logging.Logger) func(*File)

func WithLogger added in v1.0.20

func WithLogger(l *logging.Logger) func(*Bucket)

Types

type Bucket

type Bucket struct {
	Name         string
	Profile      string
	DownloadPath string
	Session      *session.Session
	Logger       *logging.Logger
}

func New

func New(options ...func(*Bucket)) *Bucket

func (*Bucket) Download

func (b *Bucket) Download() ([]File, error)

type File

type File struct {
	ID           primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	OwnerID      primitive.ObjectID `bson:"ownerId,omitempty" json:"ownerId,omitempty"`
	Company      string             `bson:"company, omitempty" json:"company,omitempty"`
	Content      string             `bson:"content", omitempty" json:"content,omitempty"`
	LastModified time.Time          `bson:"lastModified", omitempty" json:"lastModified,omitempty"`
	Size         int64              `bson:"size", omitempty" json:"size,omitempty"`
	IsProduct    bool               `bson:"isProduct", omitempty" json:"isProduct,omitempty"`
	IsParsed     bool               `bson:"isParsed", omitempty" json:"isParsed,omitempty"`
	DateCreated  time.Time          `bson:"dateCreated", omitempty" json:"dateCreated,omitempty"`
	DateModified time.Time          `bson:"dateModified", omitempty" json:"dateModified,omitempty"`
	Path         string             `bson:"path", omitempty" json:"path,omitempty"`
	ArchivedPath string             `bson:"archivedPath", omitempty" json:"archivedPath,omitempty"`
	Logger       *logging.Logger    `bson:"-" json:"-"`
}

The file Struct is used to track the status of a file's parsing and storage in the datastores

func NewFile added in v1.0.20

func NewFile(options ...func(*File)) *File

func (*File) Save

func (f *File) Save(files []interface{}) error

Save saves the file to the MongoDB database using InsertMany (bulk insert)

func (*File) ToJSON

func (f *File) ToJSON() string

func (*File) ToString

func (f *File) ToString() string

type IBucket

type IBucket interface {
	DownloadAll() []File
	Download(fileName string)
	// contains filtered or unexported methods
}

type Line

type Line struct {
	URL string `json:"url"`
}

Define a struct to hold the JSON object's URL field

Jump to

Keyboard shortcuts

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