Files
threshold/internal/bsr/options.go
shadowdaoandClaude Sonnet 5.5 962d708fdd Rename Go module paths to repo.anhonesthost.net/CyberCoveLLC/threshold
Rename root, api and sdk module paths (imports, go.mod, go_package,
ldflags, build scripts, buf configs) and regenerate protobuf/gateway
code with the project's pinned toolchain. Wire identifiers unchanged.
api gets a local replace for sdk; root/api/sdk require v0.1.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 10:33:41 -07:00

56 lines
1.2 KiB
Go

// Copyright IBM Corp. 2020, 2026
// SPDX-License-Identifier: BUSL-1.1
package bsr
import "repo.anhonesthost.net/CyberCoveLLC/threshold/internal/bsr/kms"
// getOpts - iterate the inbound Options and return a struct
func getOpts(opt ...Option) options {
opts := getDefaultOptions()
for _, o := range opt {
o(&opts)
}
return opts
}
// Option - how Options are passed as arguments
type Option func(*options)
// options = how options are represented
type options struct {
withSupportsMultiplex bool
withKeys *kms.Keys
withSha256Sum []byte
}
func getDefaultOptions() options {
return options{
withSupportsMultiplex: false,
withKeys: nil,
withSha256Sum: nil,
}
}
// WithSupportsMultiplex is used indicate that a protocol supports multiplexing
// and therefore a BSR can contain Channels.
func WithSupportsMultiplex(b bool) Option {
return func(o *options) {
o.withSupportsMultiplex = b
}
}
// WithKeys is used to provide optional kms.Keys.
func WithKeys(k *kms.Keys) Option {
return func(o *options) {
o.withKeys = k
}
}
// WithSha256Sum is used to provide a hex encoded SHA256SUM.
func WithSha256Sum(b []byte) Option {
return func(o *options) {
o.withSha256Sum = b
}
}