Documentation ¶
Index ¶
- Constants
- Variables
- func New(opts ...Option) (pb.WaypointServer, error)
- func TestApp(t testing.T, client pb.WaypointClient, ref *pb.Ref_Application)
- func TestEntrypoint(t testing.T, client pb.WaypointClient) (string, string, func())
- func TestEntrypointPlugin(t testing.T, client pb.WaypointClient) (string, string, func())
- func TestImpl(t testing.T, opts ...Option) pb.WaypointServer
- func TestRunner(t testing.T, client pb.WaypointClient, r *pb.Runner) (string, func())
- func TestServer(t testing.T, opts ...Option) pb.WaypointClient
- type Option
- func TestWithURLService(t testing.T, out *hzntest.DevSetup) Option
- func TestWithURLServiceGuestAccount(t testing.T) Option
- func WithAcceptURLTerms(accept bool) Option
- func WithConfig(scfg *serverconfig.Config) Option
- func WithDB(db *bolt.DB) Option
- func WithLogger(log hclog.Logger) Option
- func WithSuperuser() Option
Constants ¶
const ( // The username of the initial user created during bootstrapping. This // also is the user that Waypoint server versions prior to 0.5 used with // their token, so we use this to detect that scenario as well. DefaultUser = state.DefaultUser // The ID of the initial user created during bootstrapping. DefaultUserId = state.DefaultUserId // The identifier for the default key to use to generating tokens. DefaultKeyId = "k1" )
Variables ¶
var (
ErrInvalidToken = errors.New("invalid authentication token")
)
Functions ¶
func New ¶
func New(opts ...Option) (pb.WaypointServer, error)
New returns a Waypoint server implementation that uses BotlDB plus in-memory locks to operate safely.
func TestApp ¶
func TestApp(t testing.T, client pb.WaypointClient, ref *pb.Ref_Application)
TestApp creates the app in the DB.
func TestEntrypoint ¶
func TestEntrypoint(t testing.T, client pb.WaypointClient) (string, string, func())
func TestEntrypointPlugin ¶ added in v0.3.0
func TestEntrypointPlugin(t testing.T, client pb.WaypointClient) (string, string, func())
func TestImpl ¶
func TestImpl(t testing.T, opts ...Option) pb.WaypointServer
TestImpl returns the waypoint server implementation. This can be used with server.TestServer. It is easier to just use TestServer directly.
func TestRunner ¶
func TestRunner(t testing.T, client pb.WaypointClient, r *pb.Runner) (string, func())
TestRunner registers a runner and returns the ID and a function to deregister the runner. This uses t.Cleanup so that the runner will always be deregistered on test completion.
func TestServer ¶
func TestServer(t testing.T, opts ...Option) pb.WaypointClient
TestServer starts a singleprocess server and returns the connected client. We use t.Cleanup to ensure resources are automatically cleaned up.
Types ¶
type Option ¶
type Option func(*service, *config) error
func TestWithURLService ¶
TestWithURLService is an Option for testing only that creates an in-memory URL service server. This requires access to an external postgres server.
If out is non-nil, it will be written to with the DevSetup info.
func TestWithURLServiceGuestAccount ¶ added in v0.3.0
func TestWithURLServiceGuestAccount(t testing.T) Option
TestWithURLServiceGuestAccount sets the API token to empty to force getting a guest account with the URL service. This can ONLY be set if TestWithURLService is set before this.
func WithAcceptURLTerms ¶
WithAcceptURLTerms will set the config to either accept or reject the terms of service for using the URL service. Rejecting the TOS will disable the URL service. Note that the actual rejection does not occur until the waypoint horizon client attempts to register its guest account.
func WithConfig ¶
func WithConfig(scfg *serverconfig.Config) Option
WithConfig sets the server config in use with this server.
func WithLogger ¶
func WithLogger(log hclog.Logger) Option
WithLogger sets the logger for use with the server.
func WithSuperuser ¶ added in v0.5.0
func WithSuperuser() Option
WithSuperuser forces all API actions to behave as if a superuser made them. This is usually turned on for local mode only. There is no option (at the time of writing) to enable this on a network-attached server.
Source Files ¶
- auth.go
- poll.go
- poll_application.go
- poll_project.go
- prune.go
- service.go
- service_artifact.go
- service_auth_method.go
- service_auth_oidc.go
- service_build.go
- service_config.go
- service_deploy.go
- service_entrypoint.go
- service_exec.go
- service_hostname.go
- service_instance.go
- service_job.go
- service_logs.go
- service_ondemand_runner.go
- service_project.go
- service_release.go
- service_runner.go
- service_server.go
- service_snapshot.go
- service_status_report.go
- service_ui_deploy.go
- service_ui_project.go
- service_ui_release.go
- service_url.go
- service_user.go
- service_version.go
- service_waypointhcl.go
- service_workspace.go
- testing.go