github.com/blend/go-sdk@v1.20220411.3/configutil/bool_func.go (about) 1 /* 2 3 Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file. 5 6 */ 7 8 package configutil 9 10 import "context" 11 12 var ( 13 _ BoolSource = (*BoolFunc)(nil) 14 ) 15 16 // BoolFunc is a bool value source. 17 // It can be used with configutil.SetBool 18 type BoolFunc func(context.Context) (*bool, error) 19 20 // Bool returns an invocation of the function. 21 func (vf BoolFunc) Bool(ctx context.Context) (*bool, error) { 22 return vf(ctx) 23 }