avest

package module
v0.0.0-...-3df9ffb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2018 License: MIT Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

avest

A Testing framework for Avalanche web server

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommonConfigs = map[string]interface{}{
	"app.hjson": map[string]interface{}{
		"debug": true,
	},
	"rdbms.hjson": map[string]interface{}{
		"app": "sqlite3",
		"runtime": map[string]interface{}{
			"migrations": "migrations",
			"connection": "sqlite3",
		},
		"connections": map[string]interface{}{
			"sqlite3": map[string]interface{}{
				"driver": "sqlite3",
				"file":   "storage(\"test.db\")",
			},
		},
	},
	"server.hjson": map[string]interface{}{
		"address": "127.0.0.1",
		"port":    8181,
		"sessions": map[string]interface{}{
			"auto":       true,
			"driver":     "redis",
			"connection": "default",
		},
	},
	"redis.hjson": map[string]interface{}{
		"connections": map[string]interface{}{
			"local": map[string]interface{}{},
		},
	},
}
View Source
var CommonEnvs = map[string]string{}
View Source
var SimpleTemplates = map[string]string{
	"home.jet": `
{{ extends "layout.jet" }}

{{ block body() }}
  <main>
    This content will be yielded in the layout above.
  </main>
{{ end }}
	`,
	"layout.jet": `
<!DOCTYPE html>
<html>
  <head></head>
  <body>
    {{yield body()}}
  </body>
</html>
	`,
	"error-debug.jet": `
{{ extends "layout.jet" }}

{{ block body() }}
<main>
    This content will be yielded in the layout above.
  </main>
	`,
	"error-deploy.jet": `
{{ extends "layout.jet" }}

{{ block body() }}
<main>
    This content will be yielded in the layout above.
  </main>
	`,
}

Functions

func CreateConfigFiles

func CreateConfigFiles(app services.Application, configs map[string]interface{})

func CreateFile

func CreateFile(path string, content []byte)

func CreateTemplateFiles

func CreateTemplateFiles(app services.Application, templates map[string]string)

func IntRef

func IntRef(i int) *int

func IntRefOrNil

func IntRefOrNil(v interface{}) *int

func MockServices

func MockServices(configs map[string]interface{}, envs map[string]string) services.Services

func StringRef

func StringRef(str string) *string

func StringRefOrNil

func StringRefOrNil(v interface{}) *string

func TestCookies

func TestCookies(t *testing.T, url string, expect map[string]string)

func TestDeleteRequestString

func TestDeleteRequestString(t *testing.T, url string, expect string)

func TestGetJSONRequest

func TestGetJSONRequest(t *testing.T, url string, expect map[string]interface{})

func TestGetRequest

func TestGetRequest(t *testing.T, url string, expect string)

func TestHTMLRequest

func TestHTMLRequest(t *testing.T, url string, see string)

func TestPostJSONRequest

func TestPostJSONRequest(t *testing.T, url string, params map[string]interface{}, expect map[string]interface{})

func TestPutJSONRequest

func TestPutJSONRequest(t *testing.T, url string, params map[string]interface{}, expect map[string]interface{})

func TestPutJSONRequestString

func TestPutJSONRequestString(t *testing.T, url string, params map[string]interface{}, expect string)

func TestSession

func TestSession(t *testing.T, first string, second string, expect map[string]string)

Types

type ServicesMock

type ServicesMock struct {
}

func (*ServicesMock) App

func (*ServicesMock) Cache

func (s *ServicesMock) Cache() services.Cache

func (*ServicesMock) Config

func (s *ServicesMock) Config() services.Config

func (*ServicesMock) GetByName

func (s *ServicesMock) GetByName(name string) interface{}

func (*ServicesMock) Hash

func (s *ServicesMock) Hash() services.Hash

func (*ServicesMock) Localization

func (s *ServicesMock) Localization() services.Localization

func (*ServicesMock) Logger

func (s *ServicesMock) Logger() services.Logger

func (*ServicesMock) Migrator

func (s *ServicesMock) Migrator() services.Migratory

func (*ServicesMock) Modules

func (s *ServicesMock) Modules() services.ModuleManager

func (*ServicesMock) Redis

func (s *ServicesMock) Redis() services.RedisClient

func (*ServicesMock) Renderer

func (s *ServicesMock) Renderer() services.RenderEngine

func (*ServicesMock) Repository

func (s *ServicesMock) Repository() services.Repository

func (*ServicesMock) Router

func (s *ServicesMock) Router() services.Router

type TestMigMigratable

type TestMigMigratable struct {
}

func (*TestMigMigratable) Down

func (t *TestMigMigratable) Down(migrator services.Migratory) error

func (*TestMigMigratable) Up

func (t *TestMigMigratable) Up(migrator services.Migratory) error

type TestMigrationModel

type TestMigrationModel struct {
	ID        int64
	MyTest    string
	CreatedAt *time.Time
}

func (*TestMigrationModel) PrimaryKey

func (t *TestMigrationModel) PrimaryKey() string

func (*TestMigrationModel) TableName

func (t *TestMigrationModel) TableName() string

type TestMigrationModule

type TestMigrationModule struct {
}

func (*TestMigrationModule) Activated

func (t *TestMigrationModule) Activated() bool

func (*TestMigrationModule) Deactivated

func (t *TestMigrationModule) Deactivated()

func (*TestMigrationModule) Description

func (t *TestMigrationModule) Description() string

func (*TestMigrationModule) GroupsHandlers

func (t *TestMigrationModule) GroupsHandlers() []*services.RouteGroup

func (*TestMigrationModule) Installed

func (t *TestMigrationModule) Installed() bool

func (*TestMigrationModule) MiddleWares

func (t *TestMigrationModule) MiddleWares() []*services.MiddleWare

func (*TestMigrationModule) Migrations

func (t *TestMigrationModule) Migrations() []services.Migratable

func (*TestMigrationModule) Purged

func (t *TestMigrationModule) Purged()

func (*TestMigrationModule) Routes

func (t *TestMigrationModule) Routes() []*services.Route

func (*TestMigrationModule) Services

func (t *TestMigrationModule) Services() map[string]func() interface{}

func (*TestMigrationModule) Templates

func (t *TestMigrationModule) Templates() []*services.Template

func (*TestMigrationModule) Title

func (t *TestMigrationModule) Title() string

func (*TestMigrationModule) Version

func (t *TestMigrationModule) Version() string

type TestRouteMigratable

type TestRouteMigratable struct {
}

func (*TestRouteMigratable) Down

func (t *TestRouteMigratable) Down(migrator services.Migratory) error

func (*TestRouteMigratable) Up

func (t *TestRouteMigratable) Up(migrator services.Migratory) error

type TestRouteModel

type TestRouteModel struct {
	ID        int64
	MyTest    *string
	MyInt     *int
	CreatedAt *time.Time
}

func (*TestRouteModel) PrimaryKey

func (t *TestRouteModel) PrimaryKey() string

func (*TestRouteModel) TableName

func (t *TestRouteModel) TableName() string

type TestRouteModule

type TestRouteModule struct {
	S services.Services
}

func (*TestRouteModule) Activated

func (t *TestRouteModule) Activated() bool

func (*TestRouteModule) Deactivated

func (t *TestRouteModule) Deactivated()

func (*TestRouteModule) Description

func (t *TestRouteModule) Description() string

func (*TestRouteModule) GroupsHandlers

func (t *TestRouteModule) GroupsHandlers() []*services.RouteGroup

func (*TestRouteModule) Installed

func (t *TestRouteModule) Installed() bool

func (*TestRouteModule) MiddleWares

func (t *TestRouteModule) MiddleWares() []*services.MiddleWare

func (*TestRouteModule) Migrations

func (t *TestRouteModule) Migrations() []services.Migratable

func (*TestRouteModule) Purged

func (t *TestRouteModule) Purged()

func (*TestRouteModule) Routes

func (t *TestRouteModule) Routes() []*services.Route

func (*TestRouteModule) Services

func (t *TestRouteModule) Services() map[string]func() interface{}

func (*TestRouteModule) Templates

func (t *TestRouteModule) Templates() []*services.Template

func (*TestRouteModule) Title

func (t *TestRouteModule) Title() string

func (*TestRouteModule) Version

func (t *TestRouteModule) Version() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址