Documentation ¶
Index ¶
Constants ¶
const AuthHeader = "authorization"
AuthHeader is the name of the header that contains the basic authoriztation password.
Variables ¶
This section is empty.
Functions ¶
func AuthSecret ¶
AuthSecret returns a secret using the secret file as given in environment variable. In case of development it uses the development password.
func CreateFile ¶
CreateFile creates a file in the given directory with the given content. Use a truthy value for force to override an existing file.
func InputOrFileOrStdin ¶
InputOrFileOrStdin takes either a command line input or a filename (which can be "-" so we read from stdin) and returns the content.
func ReadFromFileOrStdin ¶
ReadFromFileOrStdin reads the given file. If the filename is "-" it reads from stdin instead.
Types ¶
type BasicAuth ¶
type BasicAuth struct {
Password []byte
}
BasicAuth contains the password used in basic authorization process. The password will be encoded in base64. The struct implements https://pkg.go.dev/google.golang.org/grpc@v1.38.0/credentials#PerRPCCredentials
func (BasicAuth) EncPassword ¶
EncPassword returns the password encoded in base 64.
func (BasicAuth) GetRequestMetadata ¶
func (a BasicAuth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)
GetRequestMetadata gets the current request metadata. See https://pkg.go.dev/google.golang.org/grpc@v1.38.0/credentials#PerRPCCredentials
func (BasicAuth) RequireTransportSecurity ¶
RequireTransportSecurity indicates whether the credentials requires transport security. See https://pkg.go.dev/google.golang.org/grpc@v1.38.0/credentials#PerRPCCredentials
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a logger that provides logging with respect to the log level.