github.com/kubeshop/testkube@v1.17.23/pkg/logs/state/interface.go (about)

     1  package state
     2  
     3  import "context"
     4  
     5  // We need to know where to get logs from.
     6  // For pending logs it'll be fetched from the buffer
     7  // For completed logs they'll be fetched from the s3 bucket
     8  type LogState byte
     9  
    10  const (
    11  	LogStateUnknown  LogState = 0
    12  	LogStatePending  LogState = 1
    13  	LogStateFinished LogState = 2
    14  )
    15  
    16  // Interface for state storage - we need to know if log is pending or finished
    17  type Interface interface {
    18  	Get(ctx context.Context, key string) (LogState, error)
    19  	Put(ctx context.Context, key string, state LogState) error
    20  }