Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options: PrefixUnsafe #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ func Prefix(p string) Option {
})
}

// PrefixUnsafe appends the prefix that will be used in every bucket name.
// This func is "unsafe" because it doesn't attempt to normalize the prepend
// of the prefix by ensuring only a single separator character exists
// between the prefix and the suffix. Instead the onus for this check is
// placed upon the caller. This allows for prefixes to be added WITHOUT the
// automatic insertion of separator characters.
//
// Note that when used in cloned, the prefix of the parent Client is not
// replaced but is prepended to the given prefix.
func PrefixUnsafe(p string) Option {
return Option(func(c *config) {
c.Client.Prefix += p
})
}

// TagFormat represents the format of tags sent by a Client.
type TagFormat uint8

Expand Down