github.com/franciscocpg/up@v0.1.10/platform/platform.go (about)

     1  package platform
     2  
     3  import (
     4  	"io"
     5  	"time"
     6  )
     7  
     8  // TODO: these interfaces suck, clean them up ;)
     9  
    10  // Logs is the interface for viewing logs.
    11  type Logs interface {
    12  	Follow()
    13  	Since(time.Time)
    14  	io.Reader
    15  }
    16  
    17  // Interface for platforms.
    18  type Interface interface {
    19  	// Build the project.
    20  	Build() error
    21  
    22  	// Deploy to the given stage, to the
    23  	// region(s) configured by the user.
    24  	Deploy(stage string) error
    25  
    26  	// Logs returns an interface for working
    27  	// with logging data.
    28  	Logs(region, query string) Logs
    29  
    30  	// URL returns the endpoitn for the given
    31  	// region and stage combination, or an
    32  	// empty string.
    33  	URL(region, stage string) (string, error)
    34  
    35  	// TODO: finalize and document
    36  	CreateStack(region, version string) error
    37  	DeleteStack(region string, wait bool) error
    38  	ShowStack(region string) error
    39  
    40  	ShowMetrics(region, stage string, start time.Time) error
    41  }