dsl

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GivenExistingDomain

func GivenExistingDomain(ctx context.Context, t *testing.T, service AdminAPI, domain string)

GivenExistingDomain ensures that a Domain is known to the application.

This currently is a no-op since domains can't explicitly be created.

func GivenExistingPURL

func GivenExistingPURL(ctx context.Context, t *testing.T, service AdminAPI, purl *PURL)

GivenExistingPURL ensures that a PURL is known to the application.

This is done by simply creating it.

func GivenSomeUser added in v0.7.0

func GivenSomeUser(_ context.Context, t *testing.T, userService *app.UserService) *models.UserKey

GivenSomeUser creates a user and returns the key for it.

Types

type API

type API interface {
	AdminAPI
	ResolveAPI
}

API aggregates all apis.

type AdminAPI

type AdminAPI interface {
	CreateDomain(ctx context.Context, name string) error

	// SavePURL creates a new or updates an existing purl.
	//
	// If no error occurred the returned string is the path (without host) of the created PURL.
	SavePURL(ctx context.Context, purl *PURL) (string, error)
}

AdminAPI defines admin features of the application.

type PURL

type PURL struct {
	Domain string
	Name   string
	Target *url.URL
}

func NewPURL

func NewPURL(domain string, name string, target *url.URL) *PURL

type ResolveAPI

type ResolveAPI interface {
	// ResolvePURL resolves the PURL identified by domain and name, returning
	// the target of the resolved PURL.
	ResolvePURL(ctx context.Context, domain string, name string) (*url.URL, error)
}

ResolveAPI defines features for PURL resolution.

Jump to

Keyboard shortcuts

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