Skip to content

Commit 17dd429

Browse files
committed
docs: Add package documentation
1 parent 0f7abed commit 17dd429

File tree

7 files changed

+98
-0
lines changed

7 files changed

+98
-0
lines changed

api/auth/oauth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// Package auth simplifies creating token and oAuth authenticated http.Client for use with rest.Client
1516
package auth
1617

1718
import (

api/clients/automation/automation.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
// Package automation (api/clients/automation) provides a simple CRUD client for the Automations API.
18+
// For a 'smart' API client see package clients/automation.
1719
package automation
1820

1921
import (

api/clients/buckets/bucket.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// Package buckets (api/clients/buckets) provides a simple CRUD client for the Grail Bucket API.
16+
// For a 'smart' API client see package clients/buckets.
1517
package buckets
1618

1719
import (

api/clients/doc.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// @license
2+
// Copyright 2023 Dynatrace LLC
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
/*
16+
Package clients contains simple CRUD clients for the Dynatrace API.
17+
18+
For 'smarter' clients with extended functionality see package [github.com/dynatrace/dynatrace-configuration-as-code-core/clients].
19+
20+
In general, the CRUD clients make a single API call per operation, but in some cases may make several if the Dynatrace API requires it.
21+
22+
Clients implement the following methods:
23+
24+
- Get
25+
- List
26+
- Create
27+
- Update
28+
- Delete
29+
*/
30+
package clients

api/doc.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// @license
2+
// Copyright 2023 Dynatrace LLC
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
/*
16+
Package api groups packages simplifying Dynatrace API access.
17+
18+
Notably it contains the following packages
19+
- [github.com/dynatrace/dynatrace-configuration-as-code-core/api/rest] containing an extended rest client with optional features like rate-limiting, request logging, etc.
20+
- [github.com/dynatrace/dynatrace-configuration-as-code-core/api/auth] containing methods for creating authenticated rest clients
21+
- [github.com/dynatrace/dynatrace-configuration-as-code-core/api/clients] containing client implementations for specific Dynatrace APIs
22+
*/
23+
package api

api/rest/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// Package rest provides an extended rest.Client with optional behaviours like rate limiting, request/response logging, etc.
1516
package rest
1617

1718
import (

clients/doc.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// @license
2+
// Copyright 2023 Dynatrace LLC
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
/*
16+
Package clients contains 'smart' clients for the Dynatrace API.
17+
18+
These clients are generally based on those found in package api/clients, but implement logic to ensure the Dynatrace API
19+
can be used for configuration-as-code use-cases reliably.
20+
21+
For the underlying clients see package [github.com/dynatrace/dynatrace-configuration-as-code-core/api/clients].
22+
23+
In general, whereas the CRUD api/clients make a single API call per operation, the ones in this package make several and
24+
react to API responses as needed.
25+
26+
For example, the clients in this package will resolve and follow pagination in their List methods, whereas an api/clients
27+
implementation requires/allows the user to handle pagination and make several requests on their own.
28+
29+
Clients implement the following methods:
30+
- Get
31+
- List
32+
- Create
33+
- Update
34+
- Upsert (Create or Update as needed)
35+
- Delete
36+
37+
A clients.Factory simplifies creation of clients.
38+
*/
39+
package clients

0 commit comments

Comments
 (0)