github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/db/migration/source.go (about)

     1  package migration
     2  
     3  import (
     4  	"github.com/gobuffalo/packr"
     5  )
     6  
     7  //go:generate counterfeiter . Bindata
     8  
     9  type Bindata interface {
    10  	AssetNames() []string
    11  	Asset(name string) ([]byte, error)
    12  }
    13  
    14  type packrSource struct {
    15  	packr.Box
    16  }
    17  
    18  func (bs *packrSource) AssetNames() []string {
    19  	migrations := []string{}
    20  	for _, name := range bs.Box.List() {
    21  		if name != "migrations.go" {
    22  			migrations = append(migrations, name)
    23  		}
    24  	}
    25  
    26  	return migrations
    27  }
    28  
    29  func (bs *packrSource) Asset(name string) ([]byte, error) {
    30  	return bs.Box.MustBytes(name)
    31  }