README.md 2.6 KB
Newer Older
Jürgen Enge's avatar
Jürgen Enge committed
1
2
# Streaming Server

Jürgen Enge's avatar
Jürgen Enge committed
3
Memoriav Media Streaming Server
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
4

Jürgen Enge's avatar
Jürgen Enge committed
5
## Installation
6
7
    go get gitlab.switch.ch/memoriav/memobase-2020/services/streaming-server
    go build gitlab.switch.ch/memoriav/memobase-2020/services/streaming-server/cmd/server
8
9

## Test
10
    go test gitlab.switch.ch/memoriav/memobase-2020/services/streaming-server/cmd/server
Jürgen Enge's avatar
Jürgen Enge committed
11
12
13
    
## Prerequsites

Jürgen Enge's avatar
Jürgen Enge committed
14
15
16
17
18
19
MariaDB/MySQL Server with table structure of [table.sql](tables.sql) 


# Trivial Token Service

## Installation
20
21
    go get gitlab.switch.ch/memoriav/memobase-2020/services/streaming-server
    go build gitlab.switch.ch/memoriav/memobase-2020/sevices/streaming-server/cmd/tokenService
Jürgen Enge's avatar
Jürgen Enge committed
22
    
23
  
Juergen Enge's avatar
Juergen Enge committed
24
## Server Commands
Jürgen Enge's avatar
Jürgen Enge committed
25

Juergen Enge's avatar
Juergen Enge committed
26
27
28
29
30
31
32
### clearcache    
    https://media.memobase.k8s.unibas.ch/command/clearcache?token=XXX

Token Subject: ```cmd:clearcache```
        
Clears the internal media cache of the server. 
should be done after changeing database contents.
33
    
Juergen Enge's avatar
Juergen Enge committed
34
35
36
37
38
39
40
41
42
43
### media query

    https://media.memobase.k8s.unibas.ch/memo/<signature>/<command>
  
Token Subject: ```<signature>```
  
* master
   
   Delivers the mediaserver's master object without any transformation.
   Mainly used for audio and video objects.
Jürgen Enge's avatar
Jürgen Enge committed
44
    
Juergen Enge's avatar
Juergen Enge committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
* resize
  
  Default command for image retrieval. Needs obligatory size parameter.
  
        http://localhost:88/memo/sig-5005/resize/size800x200/stretch/formatJPEG      
* iiif

  sends parameters directly to iiif image server
  
        http://localhost:88/memo/sig-5005/iiif/full/800,200/0/default.jpg
        http://localhost:88/memo/sig-5005/iiif/info.json
           
## Syntax

###Notational Conventions and Generic Grammar
Grammar is based on the Grammar used in RFC1616
https://tools.ietf.org/html/rfc2616#page-14

~~~~   
   memo_Url = serverBase "/" (dataReqest | serverCommand) 
   serverCommand = "command" "/" (clearcache) token
   clearcache = "clearcache"
   dataRequest = data-Base "/" signature "/" media-Command [token]
   data-Base = TEXT
   signature = TEXT
   media-Command = master | resize | iiif
   master = "master"
   resize = "resize" "/" size ["/" (stretch | crop)] ["/" flip] ["/" format]
   size = "size" width "x" height
   width = 1*DIGIT
   height = 1*DIGIT
   stretch = "stretch"
   crop = "crop"
   flip = "flip"
   format = "format" ("PNG" ¦ "JPEG")
   iiif = "iiif" "/" (iiif-ImageRequest | iiif-InformationRequest)
   iiif-InformationRequest = "info.json"
   iiif-ImageRequest = iiifregion "/" iiifsize "/" iiifrotation "/" iiifquality "." iiifformat
      ; please refer to iiif api - https://iiif.io/api/image/2.0/#uri-syntax
   token = "?token=" HEX
~~~~    

Jürgen Enge's avatar
Jürgen Enge committed
87
    
88
### Docker
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
89
90

```sh
91
92
docker run -v<path_to_config>:/app/memostream.toml <image_name>
```