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: storage.go
    path of file: ./repos/flipt/internal/config
    
    the code of the file until where you have to start completion: package config

import (
	"errors"
	"fmt"
	"os"
	"path/filepath"
	"time"

	"github.com/spf13/viper"
	"go.flipt.io/flipt/internal/oci"
)

// cheers up the unparam linter
var _ defaulter = (*StorageConfig)(nil)

type StorageType string

const (
	DatabaseStorageType = StorageType("database")
	LocalStorageType    = StorageType("local")
	GitStorageType      = StorageType("git")
	ObjectStorageType   = StorageType("object")
	OCIStorageType      = StorageType("oci")
)

type ObjectSubStorageType string

const (
	S3ObjectSubStorageType     = ObjectSubStorageType("s3")
	AZBlobObjectSubStorageType = ObjectSubStorageType("azblob")
	GSBlobObjectSubStorageType = ObjectSubStorageType("googlecloud")
)

// StorageConfig contains fields which will configure the type of backend in which Flipt will serve
// flag state.
type StorageConfig struct {
	Type     StorageType `json:"type,omitempty" mapstructure:"type" yaml:"type,omitempty"`
	Local    *Local      `json:"local,omitempty" mapstructure:"local,omitempty" yaml:"local,omitempty"`
    
func (c *StorageConfig) setDefaults(v *viper.Viper) error {
	switch v.GetString("storage.type") {
	case string(LocalStorageType):
		v.SetDefault("storage.local.path", ".")
	case string(GitStorageType):
		v.SetDefault("storage.git.ref", "main")
		v.SetDefault("storage.git.poll_interval", "30s")
		v.SetDefault("storage.git.insecure_skip_tls", false)
		if v.GetString("storage.git.authentication.ssh.password") != "" ||
			v.GetString("storage.git.authentication.ssh.private_key_path") != "" ||
			v.GetString("storage.git.authentication.ssh.private_key_bytes") != "" {
			v.SetDefault("storage.git.authentication.ssh.user", "git")
		}
	case string(ObjectStorageType):
		// keep this as a case statement in anticipation of
		// more object types in the future
		// nolint:gocritic
		switch v.GetString("storage.object.type") {
		case string(S3ObjectSubStorageType):
			v.SetDefault("storage.object.s3.poll_interval", "1m")
		case string(AZBlobObjectSubStorageType):
			v.SetDefault("storage.object.azblob.poll_interval", "1m")
		case string(GSBlobObjectSubStorageType):
			v.SetDefault("storage.object.googlecloud.poll_interval", "1m")
		}

	case string(OCIStorageType):
		v.SetDefault("storage.oci.poll_interval", "30s")

		dir, err := DefaultBundleDir()
		if err != nil {
			return err
		}

		v.SetDefault("storage.oci.bundles_directory", dir)
	default:
		v.SetDefault("storage.type", "database")
	}

	return nil
}