rcloneconfig

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustRenderLocal

func MustRenderLocal(name string) string

MustRenderLocal panics on error. @group Config

func MustRenderS3

func MustRenderS3(opts S3Remote) string

MustRenderS3 panics on error. @group Config

func RenderLocal

func RenderLocal(remote LocalRemote) (string, error)

RenderLocal returns ini-formatted rclone config for a local backend. @group Config

Example

ExampleRenderLocal shows generating a local remote section.

cfg, err := RenderLocal(LocalRemote{Name: "localdata"})
fmt.Println(err == nil)
fmt.Println(cfg)
Output:
true
[localdata]
type = local

func RenderS3

func RenderS3(opts S3Remote) (string, error)

RenderS3 returns ini-formatted rclone config content for a single S3 remote. @group Config

Example

ExampleRenderS3 shows generating an S3 remote section.

cfg, err := RenderS3(S3Remote{
	Name:            "s3primary",
	Region:          "us-east-1",
	AccessKeyID:     "AKIA...",
	SecretAccessKey: "SECRET",
	Endpoint:        "http://localhost:4566",
	PathStyle:       true,
})
fmt.Println(err == nil)
fmt.Println(cfg)
Output:
true
[s3primary]
type = s3
provider = AWS
access_key_id = AKIA...
secret_access_key = SECRET
region = us-east-1
endpoint = http://localhost:4566
force_path_style = true

Types

type LocalRemote

type LocalRemote struct {
	Name string
}

LocalRemote defines a local backend configuration.

type S3Remote

type S3Remote struct {
	Name               string
	Endpoint           string
	Region             string
	AccessKeyID        string
	SecretAccessKey    string
	Provider           string // optional, defaults to "AWS"
	PathStyle          bool
	BucketACL          string // optional
	UseUnsignedPayload bool   // optional
}

S3Remote defines parameters for constructing an rclone S3 remote.

Jump to

Keyboard shortcuts

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