Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotPrefixTransport = errors.New("registration does not use Prefix transport") ErrMissingRegistration = errors.New("no registration to modify") )
Functions ¶
func NewPrefixTransportOverride ¶
func NewPrefixTransportOverride(prefixesPath string) (interfaces.RegOverride, error)
NewPrefixTransportOverride returns an object that implements the Override trait specific to when the Prefix transport it used. If no path is provided, then a nil Override object will be returned along with a nil error as this is expected behavior.
Types ¶
type FixedPrefixOverride ¶
type FixedPrefixOverride struct {
// contains filtered or unexported fields
}
FixedPrefixOverride allows the registration server to override the prefix chosen by the client when they register using the Prefix transport with `disable_registration_overrides` enabled.
func NewFixedPrefixOverride ¶
func NewFixedPrefixOverride(p prefix.Prefix) *FixedPrefixOverride
NewFixedPrefixOverride returns an object that implements the Override trait specific to when the Prefix transport it used. This is primarily for testing to ensure that the override system works in practice.
func (*FixedPrefixOverride) Override ¶
func (fpo *FixedPrefixOverride) Override(reg *pb.C2SWrapper, randReader io.Reader) error
Override implements the RegOverride interface.
type PrefixOverride ¶
type PrefixOverride struct {
// contains filtered or unexported fields
}
PrefixOverride allows the registration server to override the prefix chosen by the client when they register using the Prefix transport with `allow_registration_overrides` enabled.
func ParsePrefixes ¶
func ParsePrefixes(conf io.Reader) (*PrefixOverride, error)
ParsePrefixes allows prefix overrides to be parsed from an io.Reader
func (*PrefixOverride) Override ¶
func (po *PrefixOverride) Override(reg *pb.C2SWrapper, randReader io.Reader) error
Override implements the RegOverride interface.
type RandPrefixOverride ¶
type RandPrefixOverride struct{}
RandPrefixOverride allows the registration server to override the prefix chosen by the client when they register using the Prefix transport with `disable_registration_overrides` enabled.
func NewRandPrefixOverride ¶
func NewRandPrefixOverride() *RandPrefixOverride
NewRandPrefixOverride returns an object that implements the Override trait specific to when the Prefix transport it used. This is primarily for testing to ensure that the override system works in practice.
func (*RandPrefixOverride) Override ¶
func (rpo *RandPrefixOverride) Override(reg *pb.C2SWrapper, randReader io.Reader) error
Override implements the RegOverride interface.