s3client

package
v0.0.0-...-e54010c Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Overview

s3 client implements a simple client with upload struct as JSON record the JSON is '\n' terminated and is added in a path format base on a timestamp that is compatible with Athena database partitioned tables

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(region string, bucket string, folder string, access string, secret string) (*Client, error)

New creates an S3 client

folder is optional root folder, if present "<folder>/" is prepended to upload path

func (*Client) PathFromTimestamp

func (c *Client) PathFromTimestamp(prefix string, timestamp time.Time) (string, error)

PathFromTimestamp create a path with a root folder compatible to Athena table with timestamp partitioning

func (*Client) Upload

func (c *Client) Upload(path string, data interface{}) error

Upload a json record to a path in the bucket

Jump to

Keyboard shortcuts

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