github.com/blend/go-sdk@v1.20220411.3/async/checker.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 async
     9  
    10  import "context"
    11  
    12  // Checker is a type that can be checked for SLA status.
    13  type Checker interface {
    14  	Check(context.Context) error
    15  }
    16  
    17  var (
    18  	_ Checker = (*CheckerFunc)(nil)
    19  )
    20  
    21  // CheckerFunc implements Checker.
    22  type CheckerFunc func(context.Context) error
    23  
    24  // Check implements Checker.
    25  func (cf CheckerFunc) Check(ctx context.Context) error {
    26  	return cf(ctx)
    27  }