//credentials should be username + password encoded in the basic auth standard
credentials should be username + password encoded in the basic auth standard
// credentials should be username + password encoded in the basic auth standard
func NewClient(credentials string) *Client {
	c := &Client{}
	credentialsBytes, err := base64.StdEncoding.DecodeString(strings.TrimPrefix(credentials, "Basic "))
	if err != nil {
		log.Printf("Decoding credentials failed: %v", err)
	}
	decodedCredentials := strings.Split(string(credentialsBytes), ":")
	c.Username = decodedCredentials[0]
	c.credentials = credentials
	return c
}
func NewClient ( credentials string ) * Client { c := & Client { } credentialsBytes , err := base64 . StdEncoding . DecodeString ( strings . TrimPrefix ( credentials , " " ) ) if err != nil { log . Printf ( " " , err ) } decodedCredentials := strings . Split ( string ( credentialsBytes ) , " " ) c . Username = decodedCredentials [ 0 ] c . credentials = credentials return c }
credentials should be username + password encoded in the basic auth standard
credentials should be username + password encoded in the basic auth standard