github.com/iotexproject/iotex-core@v1.14.1-rc1/pkg/probe/options.go (about) 1 // Copyright (c) 2019 IoTeX Foundation 2 // This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability 3 // or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed. 4 // This source code is governed by Apache License 2.0 that can be found in the LICENSE file. 5 6 package probe 7 8 import "net/http" 9 10 // WithReadinessHandler is an option to set a readiness handler for probe server. 11 func WithReadinessHandler(h http.Handler) interface{ Option } { 12 return &readinessOption{h} 13 } 14 15 type readinessOption struct{ h http.Handler } 16 17 func (o *readinessOption) SetOption(s *Server) { s.readinessHandler = o.h }