ls3viewer

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 35 Imported by: 1

README

ls3viewer

Latest GitHub release Github Actions test License

ls3viewer is a simple viewer to easily browse S3 using AWS Lambda. It is a simple viewer with Basic Authentication or Google Authentication.

Install

Homebrew (macOS and Linux)
$ brew install mashiike/tap/ls3viewer
Binary packages

Releases

How to use in local environment

$ ls3viewer --bucket-name infra-dev

access http://localhost:8080

How to use on AWS Lambda runtime

The executable binary can be launched as a bootstrap for Lambda.

deploy one lambda functions, ls3viewer in lambda directory
The example of lambda directory uses lambroll for deployment.

For more information on the infrastructure around lambda functions, please refer to example.tf.

LICENSE

MIT License

Copyright (c) 2022 IKEDA Masashi

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNew

func MustNew(bucketName string, objectKeyPrefix string, optFns ...func(*Options)) http.Handler

func New

func New(bucketName string, objectKeyPrefix string, optFns ...func(*Options)) (http.Handler, error)

func WithAccessLogger

func WithAccessLogger() func(*Options)

func WithBaseURL

func WithBaseURL(baseURL string) func(*Options)

func WithBasicAuth

func WithBasicAuth(user, pass string) func(*Options)

func WithGoogleOIDC

func WithGoogleOIDC(clientID string, clientSecret string, sessionEncryptKey []byte, allowed []string, denieded []string) func(*Options)

func WithListObjectsParPage added in v0.2.0

func WithListObjectsParPage(l int32) func(*Options)

func WithLogger

func WithLogger(l LoggerFunc) func(*Options)

func WithRecover

func WithRecover() func(*Options)

Types

type LoggerFunc

type LoggerFunc func(level string, v ...interface{})

type Options

type Options struct {
	ListObjectsParPage int32
	HTMLTemplate       string
	S3Client           S3Client
	Logger             LoggerFunc
	BaseURL            string
	Middleware         []func(http.Handler) http.Handler
}

type S3Client

type S3Client interface {
	manager.DownloadAPIClient
	ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input, optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error)
	HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error)
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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