github.com/alloyzeus/go-azfl@v0.0.0-20231220071816-9740126a2d07/azcore/context.go (about)

     1  package azcore
     2  
     3  import (
     4  	"context"
     5  
     6  	"golang.org/x/text/language"
     7  )
     8  
     9  // Context is a generalized context for all service methods.
    10  type Context interface {
    11  	context.Context
    12  
    13  	AZContext()
    14  }
    15  
    16  // HumanContext is a specialized context, where current processing
    17  // was initiated by a human.
    18  type HumanContext interface {
    19  	Context
    20  
    21  	// AcceptLanguage is analogous to HTTP Accept-Language header field. The
    22  	// languages must be ordered by the human's preference.
    23  	// If the languages comes as weighted, as found in HTTP Accept-Language,
    24  	// sort the languages by their weights then drop the weights.
    25  	AcceptLanguage() []language.Tag
    26  }