diff --git a/docs/building.md b/docs/building.md index 784946f4c..4c0c3dac0 100644 --- a/docs/building.md +++ b/docs/building.md @@ -12,7 +12,7 @@ geekdocFilePath: building.md 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/{{ Name }}.git +git clone https://github.com/owncloud/ocis-thubnails.git cd {{ Name }} {{< / highlight >}} diff --git a/docs/grpc.md b/docs/grpc.md index ccb334b79..a4b8e2f9d 100644 --- a/docs/grpc.md +++ b/docs/grpc.md @@ -7,70 +7,34 @@ geekdocEditPath: edit/master/docs geekdocFilePath: grpc.md --- - - -## Table of Contents - -- [pkg/proto/v0/thumbnails.proto](#pkg/proto/v0/thumbnails.proto) - - [GetRequest](#com.owncloud.ocis.thumbnails.v0.GetRequest) - - [GetResponse](#com.owncloud.ocis.thumbnails.v0.GetResponse) - - - [GetRequest.FileType](#com.owncloud.ocis.thumbnails.v0.GetRequest.FileType) - - - [ThumbnailService](#com.owncloud.ocis.thumbnails.v0.ThumbnailService) - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

+{{< toc >}} ## pkg/proto/v0/thumbnails.proto - - - - ### GetRequest -A request to retrieve a thumbnail +A request to retrieve a thumbnail | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | filepath | [string](#string) | | The path to the source image | -| filetype | [GetRequest.FileType](#com.owncloud.ocis.thumbnails.v0.GetRequest.FileType) | | The type to which the thumbnail should get encoded to. | +| 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 +The service response | 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 | @@ -78,42 +42,30 @@ The file types to which the thumbnail cna get encoded to. | PNG | 0 | Represents PNG type | | JPG | 1 | Represents JPG type | - - - - - - - - ### ThumbnailService + A Service for handling thumbnail generation | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| -| GetThumbnail | [GetRequest](#com.owncloud.ocis.thumbnails.v0.GetRequest) | [GetResponse](#com.owncloud.ocis.thumbnails.v0.GetResponse) | Generates the thumbnail and returns it. | - - - - +| GetThumbnail | [GetRequest](#getrequest) | [GetResponse](#getresponse) | Generates the thumbnail and returns it. | ## Scalar Value Types -| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | -| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | -| double | | double | double | float | float64 | double | float | Float | -| float | | float | float | float | float32 | float | float | Float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | -| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | - +| .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 | diff --git a/docs/grpc.tmpl b/docs/grpc.tmpl index 814a8713b..d7c9da3e5 100644 --- a/docs/grpc.tmpl +++ b/docs/grpc.tmpl @@ -7,106 +7,69 @@ geekdocEditPath: edit/master/docs geekdocFilePath: grpc.md --- - +{{`{{< toc >}}`}} -## Table of Contents -{{range .Files}} -{{$file_name := .Name}}- [{{.Name}}](#{{.Name}}) - {{- if .Messages }} - {{range .Messages}} - [{{.LongName}}](#{{.FullName}}) - {{end}} - {{- end -}} - {{- if .Enums }} - {{range .Enums}} - [{{.LongName}}](#{{.FullName}}) - {{end}} - {{- end -}} - {{- if .Extensions }} - {{range .Extensions}} - [File-level Extensions](#{{$file_name}}-extensions) - {{end}} - {{- end -}} - {{- if .Services }} - {{range .Services}} - [{{.Name}}](#{{.FullName}}) - {{end}} - {{- end -}} -{{end}} -- [Scalar Value Types](#scalar-value-types) +{{ range .Files -}} +## {{ .Name }} -{{range .Files}} -{{$file_name := .Name}} - -

Top

+{{ .Description }} +{{- range .Messages -}} +{{- /* remove newline */}}### {{ .LongName }} -## {{.Name}} -{{.Description}} +{{ .Description }} -{{range .Messages}} - - -### {{.LongName}} -{{.Description}} - -{{if .HasFields}} +{{ if .HasFields -}} | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -{{range .Fields -}} - | {{.Name}} | [{{.LongType}}](#{{.FullType}}) | {{.Label}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} | -{{end}} -{{end}} - -{{if .HasExtensions}} +{{ range .Fields -}} +| {{.Name}} | [{{.LongType}}](#{{.LongType | lower | replace "." "" }}) | {{.Label}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end }} | +{{ end -}} +{{ end }} +{{ if .HasExtensions -}} | Extension | Type | Base | Number | Description | | --------- | ---- | ---- | ------ | ----------- | -{{range .Extensions -}} - | {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} | -{{end}} -{{end}} +{{ range .Extensions -}} +| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} | +{{ end -}} +{{ end -}} +{{ end -}} +{{- range .Enums -}} +### {{ .LongName }} -{{end}} - -{{range .Enums}} - - -### {{.LongName}} -{{.Description}} +{{ .Description }} | Name | Number | Description | | ---- | ------ | ----------- | {{range .Values -}} - | {{.Name}} | {{.Number}} | {{nobr .Description}} | -{{end}} +| {{.Name}} | {{.Number}} | {{nobr .Description}} | +{{ end -}} +{{ end -}} -{{end}} - -{{if .HasExtensions}} - +{{ if .HasExtensions }} ### File-level Extensions | Extension | Type | Base | Number | Description | | --------- | ---- | ---- | ------ | ----------- | -{{range .Extensions -}} - | {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: `{{.DefaultValue}}`{{end}} | -{{end}} -{{end}} +{{ range .Extensions -}} +| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: `{{.DefaultValue}}`{{end}} | +{{ end -}} +{{ end -}} +{{- range .Services }} +### {{ .Name }} -{{range .Services}} - - -### {{.Name}} -{{.Description}} +{{ .Description }} | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| -{{range .Methods -}} - | {{.Name}} | [{{.RequestLongType}}](#{{.RequestFullType}}){{if .RequestStreaming}} stream{{end}} | [{{.ResponseLongType}}](#{{.ResponseFullType}}){{if .ResponseStreaming}} stream{{end}} | {{nobr .Description}} | -{{end}} -{{end}} - -{{end}} - +{{ range .Methods -}} +| {{.Name}} | [{{.RequestLongType}}](#{{.RequestLongType | lower | replace "." "" }}){{if .RequestStreaming}} stream{{end}} | [{{.ResponseLongType}}](#{{.ResponseLongType | lower | replace "." "" }}){{if .ResponseStreaming}} stream{{end}} | {{nobr .Description}} | +{{ end -}} +{{ end -}} +{{ end }} ## Scalar Value Types -| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | -| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | -{{range .Scalars -}} - | {{.ProtoType}} | {{.Notes}} | {{.CppType}} | {{.JavaType}} | {{.PythonType}} | {{.GoType}} | {{.CSharp}} | {{.PhpType}} | {{.RubyType}} | -{{end}} +| .proto Type | Notes | C++ | Java | +| ----------- | ----- | --- | ---- | +{{ range .Scalars -}} +| {{`{{< div id="`}}{{.ProtoType}}{{`" content="`}}{{.ProtoType}}{{`" >}}`}} | {{.Notes}} | {{.CppType}} | {{.JavaType}} | +{{ end }} \ No newline at end of file