github.com/blend/go-sdk@v1.20220411.3/configutil/string_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  	_ StringSource = (*StringFunc)(nil)
    14  )
    15  
    16  // StringFunc is a value source from a function.
    17  type StringFunc func(context.Context) (*string, error)
    18  
    19  // String returns an invocation of the function.
    20  func (svf StringFunc) String(ctx context.Context) (*string, error) {
    21  	return svf(ctx)
    22  }