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