Skip to content

Commit

Permalink
Merge pull request #117 from onmetal/api_reference
Browse files Browse the repository at this point in the history
Added API reference documentation and docs generation
  • Loading branch information
afritzler authored Aug 17, 2021
2 parents 1b71fc0 + 89d7217 commit fbe0128
Show file tree
Hide file tree
Showing 17 changed files with 5,435 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ fmt: ## Run go fmt against code.
vet: ## Run go vet against code.
go vet ./...

dep: ## Run go get to fetch all necessary dependencies.
# Run go get in /tmp folder to prevent adding go tools into go.mod
cd /tmp; go get github.com/ahmetb/gen-crd-api-reference-docs

docs: dep ## Run go generate to generate API reference documentation.
go generate ./...

ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: manifests generate fmt vet ## Run tests.
mkdir -p ${ENVTEST_ASSETS_DIR}
Expand Down
28 changes: 28 additions & 0 deletions apis/compute/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2021 by the OnMetal authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Package v1alpha1 is the v1alpha1 version of the API.
// +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
// +k8s:protobuf-gen=package

//go:generate gen-crd-api-reference-docs -api-dir . -config ../../../hack/api-reference/compute-config.json -template-dir ../../../hack/api-reference/template -out-file ../../../docs/api-reference/compute.md

// Package v1beta1 is a version of the API.
// +groupName=compute.onmetal.de

package v1alpha1
28 changes: 28 additions & 0 deletions apis/core/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2021 by the OnMetal authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Package v1alpha1 is the v1alpha1 version of the API.
// +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
// +k8s:protobuf-gen=package

//go:generate gen-crd-api-reference-docs -api-dir . -config ../../../hack/api-reference/core-config.json -template-dir ../../../hack/api-reference/template -out-file ../../../docs/api-reference/core.md

// Package v1beta1 is a version of the API.
// +groupName=compute.onmetal.de

package v1alpha1
28 changes: 28 additions & 0 deletions apis/network/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2021 by the OnMetal authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Package v1alpha1 is the v1alpha1 version of the API.
// +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
// +k8s:protobuf-gen=package

//go:generate gen-crd-api-reference-docs -api-dir . -config ../../../hack/api-reference/network-config.json -template-dir ../../../hack/api-reference/template -out-file ../../../docs/api-reference/network.md

// Package v1beta1 is a version of the API.
// +groupName=compute.onmetal.de

package v1alpha1
28 changes: 28 additions & 0 deletions apis/storage/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2021 by the OnMetal authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Package v1alpha1 is the v1alpha1 version of the API.
// +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
// +k8s:protobuf-gen=package

//go:generate gen-crd-api-reference-docs -api-dir . -config ../../../hack/api-reference/storage-config.json -template-dir ../../../hack/api-reference/template -out-file ../../../docs/api-reference/storage.md

// Package v1beta1 is a version of the API.
// +groupName=compute.onmetal.de

package v1alpha1
Loading

0 comments on commit fbe0128

Please sign in to comment.