Documentation ¶
Index ¶
- Variables
- func BuildConsoleRouter(templateProvider TemplateProvider, templateVersion, staticDir string, ...) (*gin.Engine, error)
- func Serve(opts *ServeOpts) error
- type APIServer
- type ConsoleServer
- type DefaultTemplateProvider
- func (p *DefaultTemplateProvider) BasePath() string
- func (p *DefaultTemplateProvider) DoTemplateExist(path string) bool
- func (p *DefaultTemplateProvider) GetAssetsCDN() string
- func (p *DefaultTemplateProvider) GetAssetsVersion(v *version.Version) string
- func (p *DefaultTemplateProvider) GetTemplateVersion(v *version.Version) string
- func (p *DefaultTemplateProvider) LoadTemplates(path string, templateNames ...string) (multitemplate.Render, error)
- func (p *DefaultTemplateProvider) TemplateFilename() string
- type NewConsoleServerOpts
- type ServeOpts
- type TemplateProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ConsoleFS embed.FS
Functions ¶
func BuildConsoleRouter ¶
Types ¶
type APIServer ¶
type APIServer struct { Router *gin.Engine Migrate *migrate.Migrate Address string Port string EC *cli.ExecutionContext }
func NewAPIServer ¶
func (*APIServer) GetHTTPServer ¶
type ConsoleServer ¶
type ConsoleServer struct { Logger *logrus.Logger Port string APIPort string Address string DontOpenBrowser bool StaticDir string Browser string EC *cli.ExecutionContext TemplateProvider TemplateProvider Router *gin.Engine }
func NewConsoleServer ¶
func NewConsoleServer(opts *NewConsoleServerOpts) *ConsoleServer
func (*ConsoleServer) GetHTTPServer ¶
func (c *ConsoleServer) GetHTTPServer() (*http.Server, error)
func (*ConsoleServer) Serve ¶
func (c *ConsoleServer) Serve()
type DefaultTemplateProvider ¶
type DefaultTemplateProvider struct {
// contains filtered or unexported fields
}
DefaultTemplateProvider implements the github.com/hasura/graphl-engine/cli/pkg/templates.DefaultTemplateProvider interface
func NewDefaultTemplateProvider ¶
func NewDefaultTemplateProvider(basePath, templateFilename string, consoleFS embed.FS) *DefaultTemplateProvider
func (*DefaultTemplateProvider) BasePath ¶
func (p *DefaultTemplateProvider) BasePath() string
func (*DefaultTemplateProvider) DoTemplateExist ¶
func (p *DefaultTemplateProvider) DoTemplateExist(path string) bool
DoTemplateExist returns true if an asset exists at pathk
func (*DefaultTemplateProvider) GetAssetsCDN ¶
func (p *DefaultTemplateProvider) GetAssetsCDN() string
func (*DefaultTemplateProvider) GetAssetsVersion ¶
func (p *DefaultTemplateProvider) GetAssetsVersion(v *version.Version) string
GetAssetsVersion returns the assets version av to be used in the console template. This function is supposed to return the following: > input -> output > dev-build -> versioned/dev-build > v1.0.0-beta.01 -> beta/v1.0 > v1.0.0-alpha.01 -> alpha/v1.0 > v1.2.1-rc.03 -> rc/v1.2 > v1.1.0 -> stable/v1.1
func (*DefaultTemplateProvider) GetTemplateVersion ¶
func (p *DefaultTemplateProvider) GetTemplateVersion(v *version.Version) string
GetTemplateVersion returns the template version tv required to render the console html.
func (*DefaultTemplateProvider) LoadTemplates ¶
func (p *DefaultTemplateProvider) LoadTemplates(path string, templateNames ...string) (multitemplate.Render, error)
func (*DefaultTemplateProvider) TemplateFilename ¶
func (p *DefaultTemplateProvider) TemplateFilename() string
type NewConsoleServerOpts ¶
type TemplateProvider ¶
type TemplateProvider interface { // BasePath will return the basepath for the tempalate directory BasePath() string // This is the template filename eg: console.html, console2.html TemplateFilename() string // DoTemplateExist returns true if an asset exists at pathk DoTemplateExist(path string) bool LoadTemplates(path string, templateNames ...string) (multitemplate.Render, error) // GetTemplateVersion returns the template version tv required to render // the console html. GetTemplateVersion(v *version.Version) string // GetAssetsVersion returns the assets version av to be used in the // console template. This function is supposed to return the following: // > input -> output // > dev-build -> versioned/dev-build // > v1.0.0-beta.01 -> beta/v1.0 // > v1.0.0-alpha.01 -> alpha/v1.0 // > v1.2.1-rc.03 -> rc/v1.2 // > v1.1.0 -> stable/v1.1 GetAssetsVersion(v *version.Version) string GetAssetsCDN() string }
Click to show internal directories.
Click to hide internal directories.