Documentation ¶
Index ¶
Constants ¶
const (
UPLOADS_FOLDER string = "./uploads/"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ParsedLogEntry ¶
type ParsedLogEntry map[string]interface{}
A ParsedLogEntry is a key/value pair. The value can be anything, and the key will always be a string
func NewParsedLogEntry ¶
func NewParsedLogEntry() ParsedLogEntry
NewParsedLogEntry creates a new, blank ParsedLogEntry
func NewParsedLogEntryFromJSON ¶
func NewParsedLogEntryFromJSON(data []byte, line int) (ParsedLogEntry, error)
NewParsedLogEntryFromJSON creates a new ParsedLogEntry from JSON data
func (ParsedLogEntry) MakeTimePretty ¶
func (p ParsedLogEntry) MakeTimePretty(key string) string
MakeTimePretty attempts to format a time key in local server time
type ParsedLogFile ¶
type ParsedLogFile []ParsedLogEntry
A ParsedLogFile is essentially a slice of ParsedLogEntries
func NewParsedLogFile ¶
func NewParsedLogFile() ParsedLogFile
NewParsedLogFile creates a new slice of ParsedLogEntries
func (ParsedLogFile) GetLine ¶
func (l ParsedLogFile) GetLine(lineNumber int) ParsedLogEntry
GetLine returns the ParsedLogEntry at a specified line
type UploadService ¶
type UploadService struct {
// contains filtered or unexported fields
}
UploadService provides method to validate and upload files
func NewUploadService ¶
func NewUploadService(logger *logrus.Entry) *UploadService
NewUploadService creates a new service
func (*UploadService) Upload ¶
func (s *UploadService) Upload(fileHeader *multipart.FileHeader) (int64, error)
Upload takes a FileHeader from a file upload multipart-form and copies it to the uploads folder