booking

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: AGPL-3.0 Imports: 23 Imported by: 0

README

booking

To generate the server code, go to root of the repo then

swagger generate server -t pkg/booking -f ./api/openapi-spec/booking.yml --exclude-main -A booking

If making large changes, then there will be stale files left, so first

cd pkg/booking
rm -rf models
rm -rf restapi

Note updated manifest with config

This solves #13

The config file is specified in the manifest :

  pvna-activity-00:
    description: pvna-activity-v1.0
    config:
      url: https://assets.practable.io/config/experiments/pvna/pvna00-0.0.json
      <snip>

The config key must be included in the url template in the UI description in the manifest

  pvna-default-ui-1.0:
   <snip>
    url: https://static.practable.io/ui/pvna-1.0/?config={{config}}&streams={{streams}}&exp={{exp}}
    <snip>

The config is passed when the activity is booked

<snip> 
"config":{"url":"https://assets.practable.io/config/experiments/pvna/pvna00-0.0.json"}
<snip>

Then bookjs templates the config url in to a url parameter like this:

https://<some-ui>?config=https%3A%2F%2Fassets.practable.io%2Fconfig%2Fexperiments%2Fpvna%2Fpvna00-0.0.json&streams=<snip>

Documentation

Overview

Package booking provides an API for booking experiments

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func API

func API(ctx context.Context, port int, host, secret string, ps *pool.Store, l *bookingstore.Limit)

API starts the API Inputs @closed - channel will be closed when server shutsdown @wg - waitgroup, we must wg.Done() when we are shutdown @port - where to listen locally @host - external FQDN of the host (for checking against tokens) e.g. https://relay-access.practable.io @target - FQDN of the relay instance e.g. wss://relay.practable.io @secret- HMAC shared secret which incoming tokens will be signed with @cs - pointer to the CodeStore this API shares with the shellbar websocket relay @options - for future backwards compatibility (no options currently available)

func Token

func Token(audience, ct, topic, secret string, scopes []string, iat, nbf, exp int64) (string, error)

Token returns a signed JWT token

Types

This section is empty.

Directories

Path Synopsis
Package restapi Booking User API for booking experiments Schemes: http Host: book.practable.io BasePath: /api/v1 Version: 0.5 Contact: Tim Drysdale<timothy.d.drysdale@gmail.com> https://practable.io Consumes: - application/json Produces: - application/json swagger:meta
Package restapi Booking User API for booking experiments Schemes: http Host: book.practable.io BasePath: /api/v1 Version: 0.5 Contact: Tim Drysdale<timothy.d.drysdale@gmail.com> https://practable.io Consumes: - application/json Produces: - application/json swagger:meta

Jump to

Keyboard shortcuts

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