run remark linter locally
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
---
|
||||
* * *
|
||||
|
||||
title: "Thumbnails"
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 10
|
||||
geekdocRepo: https://github.com/owncloud/ocis-thumbnails
|
||||
geekdocRepo: <https://github.com/owncloud/ocis-thumbnails>
|
||||
geekdocEditPath: edit/master/docs
|
||||
geekdocFilePath: _index.md
|
||||
---
|
||||
|
||||
## geekdocFilePath: \_index.md
|
||||
|
||||
This service provides an ocis extensions which generates thumbnails for image files.
|
||||
|
||||
+11
-10
@@ -1,28 +1,29 @@
|
||||
---
|
||||
* * *
|
||||
|
||||
title: "Building"
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 30
|
||||
geekdocRepo: https://github.com/owncloud/ocis-thumbnails
|
||||
geekdocRepo: <https://github.com/owncloud/ocis-thumbnails>
|
||||
geekdocEditPath: edit/master/docs
|
||||
geekdocFilePath: building.md
|
||||
---
|
||||
|
||||
{{< toc >}}
|
||||
## geekdocFilePath: building.md
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
As this project is built with Go, so you need to install that first. The installation of Go is out of the scope of this document, please follow the official documentation for [Go](https://golang.org/doc/install), to build this project you have to install Go >= v1.12. After the installation of the required tools you need to get the sources:
|
||||
|
||||
{{< highlight txt >}}
|
||||
git clone https://github.com/owncloud/ocis-thubnails.git
|
||||
{{< highlight txt >}}
|
||||
git clone <https://github.com/owncloud/ocis-thubnails.git>
|
||||
cd {{ Name }}
|
||||
{{< / highlight >}}
|
||||
{{< / highlight >}}
|
||||
|
||||
All required tool besides Go itself and make are bundled or getting automatically installed within the `Gopath`. All commands to build this project are part of our `Makefile`.
|
||||
|
||||
## Backend
|
||||
|
||||
{{< highlight txt >}}
|
||||
{{< highlight txt >}}
|
||||
make generate
|
||||
make build
|
||||
{{< / highlight >}}
|
||||
{{< / highlight >}}
|
||||
|
||||
Finally you should have the binary within the `bin/` folder now, give it a try with `./bin/ocis-thumbnails -h` to see all available options.
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
---
|
||||
* * *
|
||||
|
||||
title: "Getting Started"
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis-thumbnails
|
||||
geekdocRepo: <https://github.com/owncloud/ocis-thumbnails>
|
||||
geekdocEditPath: edit/master/docs
|
||||
geekdocFilePath: getting-started.md
|
||||
---
|
||||
|
||||
{{< toc >}}
|
||||
## geekdocFilePath: getting-started.md
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -88,7 +89,7 @@ THUMBNAILS_WEBDAVSOURCE_BASEURL
|
||||
: Base url for a webdav api, defaults to `https://localhost:9200/remote.php/webdav/`
|
||||
|
||||
THUMBNAILS_RESOLUTIONS
|
||||
: List of resolutions supported by the service, defaults to `["16x16", "32x32", "64x64", "128x128"]
|
||||
: List of resolutions supported by the service, defaults to \`["16x16", "32x32", "64x64", "128x128"]
|
||||
|
||||
#### Health
|
||||
|
||||
@@ -101,68 +102,68 @@ If you prefer to configure the service with commandline flags you can see the av
|
||||
|
||||
#### Global
|
||||
|
||||
--config-file
|
||||
\--config-file
|
||||
: Path to config file, empty default value
|
||||
|
||||
--log-level
|
||||
\--log-level
|
||||
: Set logging level, defaults to `info`
|
||||
|
||||
--log-color
|
||||
\--log-color
|
||||
: Enable colored logging, defaults to `true`
|
||||
|
||||
--log-pretty
|
||||
\--log-pretty
|
||||
: Enable pretty logging, defaults to `true`
|
||||
|
||||
#### Server
|
||||
|
||||
--tracing-enabled
|
||||
\--tracing-enabled
|
||||
: Enable sending traces, defaults to `false`
|
||||
|
||||
--tracing-type
|
||||
\--tracing-type
|
||||
: Tracing backend type, defaults to `jaeger`
|
||||
|
||||
--tracing-endpoint
|
||||
\--tracing-endpoint
|
||||
: Endpoint for the agent, empty default value
|
||||
|
||||
--tracing-collector
|
||||
\--tracing-collector
|
||||
: Endpoint for the collector, empty default value
|
||||
|
||||
--tracing-service
|
||||
\--tracing-service
|
||||
: Service name for tracing, defaults to `thumbnails`
|
||||
|
||||
--debug-addr
|
||||
\--debug-addr
|
||||
: Address to bind debug server, defaults to `0.0.0.0:9189`
|
||||
|
||||
--debug-token
|
||||
\--debug-token
|
||||
: Token to grant metrics access, empty default value
|
||||
|
||||
--debug-pprof
|
||||
\--debug-pprof
|
||||
: Enable pprof debugging, defaults to `false`
|
||||
|
||||
--debug-zpages
|
||||
\--debug-zpages
|
||||
: Enable zpages debugging, defaults to `false`
|
||||
|
||||
--grpc-name
|
||||
\--grpc-name
|
||||
: Name of the service, defaults to `thumbnails`
|
||||
|
||||
--grpc-addr
|
||||
\--grpc-addr
|
||||
: Address to bind grpc server, defaults to `0.0.0.0:9185`
|
||||
|
||||
--grpc-namespace
|
||||
\--grpc-namespace
|
||||
: Set the base namespace for the grpc namespace", defaults to `com.owncloud.api`
|
||||
|
||||
--filesystemstorage-root
|
||||
\--filesystemstorage-root
|
||||
: Root path of the filesystem storage directory, defaults to `<os tempdir>/ocis-thumbnails/`
|
||||
|
||||
--webdavsource-baseurl
|
||||
\--webdavsource-baseurl
|
||||
: Base url for a webdav api, defaults to `https://localhost:9200/remote.php/webdav/`
|
||||
|
||||
--thumbnail-resolution
|
||||
: List of resolutions supported by the service, defaults to `["16x16", "32x32", "64x64", "128x128"]
|
||||
\--thumbnail-resolution
|
||||
: List of resolutions supported by the service, defaults to \`["16x16", "32x32", "64x64", "128x128"]
|
||||
|
||||
#### Health
|
||||
|
||||
--debug-addr
|
||||
\--debug-addr
|
||||
: Address to debug endpoint, defaults to `0.0.0.0:9189`
|
||||
|
||||
### Configuration file
|
||||
@@ -177,17 +178,17 @@ The program provides a few sub-commands on execution. The available configuratio
|
||||
|
||||
The server command is used to start the http and debug server on two addresses within a single process. The http server is serving the general webservice while the debug server is used for health check, readiness check and to server the metrics mentioned below. For further help please execute:
|
||||
|
||||
{{< highlight txt >}}
|
||||
{{< highlight txt >}}
|
||||
{{ Name }} server --help
|
||||
{{< / highlight >}}
|
||||
{{< / highlight >}}
|
||||
|
||||
### Health
|
||||
|
||||
The health command is used to execute a health check, if the exit code equals zero the service should be up and running, if the exist code is greater than zero the service is not in a healthy state. Generally this command is used within our Docker containers, it could also be used within Kubernetes.
|
||||
|
||||
{{< highlight txt >}}
|
||||
{{< highlight txt >}}
|
||||
{{ Name }} health --help
|
||||
{{< / highlight >}}
|
||||
{{< / highlight >}}
|
||||
|
||||
## Metrics
|
||||
|
||||
|
||||
+41
-40
@@ -1,13 +1,14 @@
|
||||
---
|
||||
* * *
|
||||
|
||||
title: "GRPC API"
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 50
|
||||
geekdocRepo: https://github.com/owncloud/ocis-thumbnails
|
||||
geekdocRepo: <https://github.com/owncloud/ocis-thumbnails>
|
||||
geekdocEditPath: edit/master/docs
|
||||
geekdocFilePath: grpc.md
|
||||
---
|
||||
|
||||
{{< toc >}}
|
||||
## geekdocFilePath: grpc.md
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
## pkg/proto/v0/thumbnails.proto
|
||||
|
||||
@@ -15,57 +16,57 @@ geekdocFilePath: grpc.md
|
||||
|
||||
A request to retrieve a thumbnail
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| filepath | [string](#string) | | The path to the source image |
|
||||
| filetype | [GetRequest.FileType](#getrequestfiletype) | | The type to which the thumbnail should get encoded to. |
|
||||
| etag | [string](#string) | | The etag of the source image |
|
||||
| width | [int32](#int32) | | The width of the thumbnail |
|
||||
| height | [int32](#int32) | | The height of the thumbnail |
|
||||
| authorization | [string](#string) | | The authorization token |
|
||||
| Field | Type | Label | Description |
|
||||
| ------------- | ------------------------------------------ | ----- | ------------------------------------------------------ |
|
||||
| filepath | [string](#string) | | The path to the source image |
|
||||
| filetype | [GetRequest.FileType](#getrequestfiletype) | | The type to which the thumbnail should get encoded to. |
|
||||
| etag | [string](#string) | | The etag of the source image |
|
||||
| width | [int32](#int32) | | The width of the thumbnail |
|
||||
| height | [int32](#int32) | | The height of the thumbnail |
|
||||
| authorization | [string](#string) | | The authorization token |
|
||||
|
||||
### GetResponse
|
||||
|
||||
The service response
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| thumbnail | [bytes](#bytes) | | The thumbnail as a binary |
|
||||
| mimetype | [string](#string) | | The mimetype of the thumbnail |
|
||||
| Field | Type | Label | Description |
|
||||
| --------- | ----------------- | ----- | ----------------------------- |
|
||||
| thumbnail | [bytes](#bytes) | | The thumbnail as a binary |
|
||||
| mimetype | [string](#string) | | The mimetype of the thumbnail |
|
||||
|
||||
### GetRequest.FileType
|
||||
|
||||
The file types to which the thumbnail cna get encoded to.
|
||||
|
||||
| Name | Number | Description |
|
||||
| ---- | ------ | ----------- |
|
||||
| PNG | 0 | Represents PNG type |
|
||||
| JPG | 1 | Represents JPG type |
|
||||
| Name | Number | Description |
|
||||
| ---- | ------ | ------------------- |
|
||||
| PNG | 0 | Represents PNG type |
|
||||
| JPG | 1 | Represents JPG type |
|
||||
|
||||
### ThumbnailService
|
||||
|
||||
A Service for handling thumbnail generation
|
||||
|
||||
| Method Name | Request Type | Response Type | Description |
|
||||
| ----------- | ------------ | ------------- | ------------|
|
||||
| Method Name | Request Type | Response Type | Description |
|
||||
| ------------ | ------------------------- | --------------------------- | --------------------------------------- |
|
||||
| GetThumbnail | [GetRequest](#getrequest) | [GetResponse](#getresponse) | Generates the thumbnail and returns it. |
|
||||
|
||||
## Scalar Value Types
|
||||
|
||||
| .proto Type | Notes | C++ | Java |
|
||||
| ----------- | ----- | --- | ---- |
|
||||
| {{< div id="double" content="double" >}} | | double | double |
|
||||
| {{< div id="float" content="float" >}} | | float | float |
|
||||
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
|
||||
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
|
||||
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
|
||||
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
|
||||
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
|
||||
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
|
||||
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
|
||||
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
|
||||
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
|
||||
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
|
||||
| {{< div id="bool" content="bool" >}} | | bool | boolean |
|
||||
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
|
||||
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
|
||||
| .proto Type | Notes | C++ | Java |
|
||||
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------- |
|
||||
| {{< div id="double" content="double" >}} | | double | double |
|
||||
| {{< div id="float" content="float" >}} | | float | float |
|
||||
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
|
||||
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
|
||||
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
|
||||
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
|
||||
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
|
||||
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
|
||||
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
|
||||
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
|
||||
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
|
||||
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
|
||||
| {{< div id="bool" content="bool" >}} | | bool | boolean |
|
||||
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
|
||||
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
---
|
||||
* * *
|
||||
|
||||
title: "License"
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 60
|
||||
geekdocRepo: https://github.com/owncloud/ocis-thumbnails
|
||||
geekdocRepo: <https://github.com/owncloud/ocis-thumbnails>
|
||||
geekdocEditPath: edit/master/docs
|
||||
geekdocFilePath: license.md
|
||||
---
|
||||
|
||||
## geekdocFilePath: license.md
|
||||
|
||||
This project is licensed under the [Apache 2.0](https://github.com/owncloud/ocis/thumbnails/blob/master/LICENSE) license. For the license of the used libraries you have to check the respective sources.
|
||||
|
||||
@@ -1,45 +1,46 @@
|
||||
---
|
||||
* * *
|
||||
|
||||
title: "Releasing"
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 40
|
||||
geekdocRepo: https://github.com/owncloud/ocis-thumbnails
|
||||
geekdocRepo: <https://github.com/owncloud/ocis-thumbnails>
|
||||
geekdocEditPath: edit/master/docs
|
||||
geekdocFilePath: releasing.md
|
||||
---
|
||||
|
||||
{{< toc >}}
|
||||
## geekdocFilePath: releasing.md
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
To release a new version of ocis-thumbnails, you have to follow a few simple steps.
|
||||
|
||||
## Preperation
|
||||
|
||||
1. Create a new branch e.g. `release-x.x.x` where `x.x.x` is the version you want to release.
|
||||
2. Checkout the preparation branch.
|
||||
3. Create a new changelog folder and move the unreleased snippets there.
|
||||
{{< highlight txt >}}
|
||||
mkdir changelog/x.x.x_yyyy-MM-dd/ # yyyy-MM-dd is the current date
|
||||
mv changelog/unreleased/* changelog/x.x.x_yyyy-MM-dd/
|
||||
{{< / highlight >}}
|
||||
4. Commit and push the changes
|
||||
{{< highlight txt >}}
|
||||
git add --all
|
||||
git commit -m "prepare release x.x.x"
|
||||
git push
|
||||
{{< / highlight >}}
|
||||
5. Create a pull request to the master branch.
|
||||
1. Create a new branch e.g. `release-x.x.x` where `x.x.x` is the version you want to release.
|
||||
2. Checkout the preparation branch.
|
||||
3. Create a new changelog folder and move the unreleased snippets there.
|
||||
{{< highlight txt >}}
|
||||
mkdir changelog/x.x.x_yyyy-MM-dd/ # yyyy-MM-dd is the current date
|
||||
mv changelog/unreleased/\* changelog/x.x.x_yyyy-MM-dd/
|
||||
{{< / highlight >}}
|
||||
4. Commit and push the changes
|
||||
{{< highlight txt >}}
|
||||
git add --all
|
||||
git commit -m "prepare release x.x.x"
|
||||
git push
|
||||
{{< / highlight >}}
|
||||
5. Create a pull request to the master branch.
|
||||
|
||||
## Release
|
||||
1. After the preparation branch has been merged update your local master.
|
||||
{{< highlight txt >}}
|
||||
git checkout master
|
||||
git pull
|
||||
{{< / highlight >}}
|
||||
2. Create a new tag (preferably signed).
|
||||
{{< highlight txt >}}
|
||||
git tag -s vx.x.x -m "release vx.x.x"
|
||||
git push --tags
|
||||
{{< / highlight >}}
|
||||
3. Wait for CI and check that the GitHub release was published.
|
||||
|
||||
1. After the preparation branch has been merged update your local master.
|
||||
{{< highlight txt >}}
|
||||
git checkout master
|
||||
git pull
|
||||
{{< / highlight >}}
|
||||
2. Create a new tag (preferably signed).
|
||||
{{< highlight txt >}}
|
||||
git tag -s vx.x.x -m "release vx.x.x"
|
||||
git push --tags
|
||||
{{< / highlight >}}
|
||||
3. Wait for CI and check that the GitHub release was published.
|
||||
|
||||
Congratulations, you just released ocis-thumbnails!
|
||||
|
||||
Reference in New Issue
Block a user