You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: secrets.go
    path of file: ./repos/pixie/src/utils/shared/k8s
    
    the code of the file until where you have to start completion: /*
 * Copyright 2018- The Pixie Authors.
 *
 * Licensed under the Apache License, Version 2
    
func CreateDockerConfigJSONSecret(namespace, name, credsData string) (*v1.Secret, error) {
	secret := &v1.Secret{}
	secret.SetGroupVersionKind(v1.SchemeGroupVersion.WithKind("Secret"))
	secret.Name = name
	secret.Type = v1.SecretTypeDockerConfigJson
	secret.Data = map[string][]byte{}

	type dockerSecret struct {
		Username string `json:"username"`
		Password string `json:"password"`
		Auth     string `json:"auth"`
	}

	type dockerConfigAuth struct {
		GcrIO dockerSecret `json:"gcr.io"`
	}

	type dockerConfig struct {
		Auths dockerConfigAuth `json:"auths"`
	}

	encodedCredsData := "_json_key:" + credsData

	credsBytes := []byte(encodedCredsData)
	encodedCreds := new(bytes.Buffer)
	encoder := base64.NewEncoder(base64.StdEncoding, encodedCreds)
	_, err := encoder.Write(credsBytes)
	if err != nil {
		return nil, err
	}
	encoder.Close()

	s := dockerConfig{
		Auths: dockerConfigAuth{
			GcrIO: dockerSecret{
				Username: "_json_key",
				Password: credsData,
				Auth:     encodedCreds.String(),
			},
		},
	}

	secretJSON, err := json.Marshal(s)
	if err != nil {
		return nil, err
	}

	secret.Data[v1.DockerConfigJsonKey] = secretJSON
	secret.Namespace = namespace

	return secret, nil
}