-
Notifications
You must be signed in to change notification settings - Fork 12
/
rejectinsecure_options.go
47 lines (37 loc) · 1.32 KB
/
rejectinsecure_options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2020 The searKing Author. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated by "go-option -type rejectInsecure"; DO NOT EDIT.
package http
var _default_RejectInsecure_value = func() (val rejectInsecure) { return }()
// A RejectInsecureOption sets options.
type RejectInsecureOption interface {
apply(*rejectInsecure)
}
// EmptyRejectInsecureOption does not alter the configuration. It can be embedded
// in another structure to build custom options.
//
// This API is EXPERIMENTAL.
type EmptyRejectInsecureOption struct{}
func (EmptyRejectInsecureOption) apply(*rejectInsecure) {}
// RejectInsecureOptionFunc wraps a function that modifies rejectInsecure into an
// implementation of the RejectInsecureOption interface.
type RejectInsecureOptionFunc func(*rejectInsecure)
func (f RejectInsecureOptionFunc) apply(do *rejectInsecure) {
f(do)
}
// sample code for option, default for nothing to change
func _RejectInsecureOptionWithDefault() RejectInsecureOption {
return RejectInsecureOptionFunc(func(*rejectInsecure) {
// TODO nothing to change
})
}
func (o *rejectInsecure) ApplyOptions(options ...RejectInsecureOption) *rejectInsecure {
for _, opt := range options {
if opt == nil {
continue
}
opt.apply(o)
}
return o
}