This project goal is to implement a GO SDK wrapper for the Edgio's REST API. This SDK is a starting point for more advanced projects like a CLI and a Terraform Provider.
- Internal Packages
- Public Packages
- edgio/common
- Cache APIs
- Deployments APIs
- Organizations APIs
- Properties APIs
- TSL Certificates APIs
- WAF (Security) APIs
- Tooling
- Contributors
- Changelog
- Roadmap
The internal package documentation is intended to potential contributors of the repository, since they are not exposed to be directly imported. If you are a user, you shoud use our public api-specific packages to develop your application.
This package provides a base client configuration and connection to Edgio's REST API, as well as configuration validation. The public packages under edgio
namespace uses this client under the hood to perform their API calls.
This constructor validates and assing default valued (if applicable) to the provided credentials and configurations and returns a client instance with a valid access token, or an error if anything goes wrong.
This function generates the fully formatted Edgio REST API's url for the desired resource, identified by its service
, scope
and apiVersion
.
Check a more in-depth documentation of thw internal/client
package here.
The main goal of this package is to hold any logic related to the aquisition/refreshing/invalidation generated by Edgio REST API client.
This func outsources the process of getting an auth token from Edgio's Auth service. It assumes Edgio's standard auth endpoint as a default URL, but that can be overwritten by your own, in the event of an enterprise/self-hosted app.
Check a more in-depth documentation of the internal/token
package here.
This package package holds some utility functions that are used to outsource some common logic from other packages to avoid repetition/ease testing.
utils.GetHttpJsonResult(httpClient *http.Client, request *http.Request, token string, model interface{}) (interface{}, error)
This function has mainly three related goals:
- Process http requests;
- treat HTTP errors in a standardized way, and;
- Process and decode returned json data from the endpoints.
Filters the list of items (haystack) by the given needle. Returns a list of items that contain the needle in their name, key or slug, depending on the entity type (Property, Environment, Variable), or an empty list if no items match the needle.
Check a more in-depth documentation of the internal/utils
package here.
The public packages are the parts of the SDK that are actually intended to be used. You should be able to import just those you need for your project.
This package expose public interfaces, structs and other functions that could not be hosted on the internal packages, since in some cases they are required by both other internal packages and some public ones, leading to cyclic imports. Due to that, they were outsourced to their own package.
Merges the other
ClientConfig into the default one, overwriting the current values with the other's if they are not empty.
Check a more in-depth documentation of the edgio/common package here.
[WIP]
This package groups Edgio Organization specific funcs.
This func returns a new client with the provided parameters, with an access token already set, and the default edgio params values for service, scope and API version (which can be overwritten if needed) to interact with your application's orgs.
This func returns the relevant organization details (name and id).
This func updates the relevant Org's name and return the Org object with the new data (name and id).
Check a more in-depth documentation of the edgio/org
package here.
Reference: Edgio Organizations REST API documentation reference.
[WIP]
This package groups Edgio Property specific funcs.
This func returns a new client with the provided parameters, with an access token already set, and the default edgio params values for service, scope and API version (which can be overwritten if needed) to interact with your application's properties.
This func lists properties for a given Edgio Organization. Edgio's list page size was defaulted to 100 for now, which is the highest value. The idea is to return all properties until actual pagination is implemented. Returns a list of properties for a given Organization or an error if anything goes wrong.
property.FilterList(params property.FilterParams) (common.FilteredListResultType[common.Property], error)
Filters the list of properties for a given Org by the property slug, and returns a list of properties that contain the provided slug, or all properties if no slug is provided.
This func retrieves a property by ID and returns it, or empty if none was found.
Returns the first property in the list that matches the slug, or nil if no properties match the slug.
Check a more in-depth documentation of the edgio/property
package here.
Reference: Edgio Properties REST API documentation reference.
[WIP]
This package groups Edgio Environment specific funcs.
This func returns a new client with the provided parameters, with an access token already set, and the default edgio params values for service, scope and API version (which can be overwritten if needed) to interact with your application's environments.
This func list environments for a given Edgio Property. Edgio's list page size was defaulted to 100 for now, which is the highest value. The idea is to return all environments until actual pagination is implemented. Returns a list of environments for a given Property or an error if anything goes wrong.
Filters the list of environments for a given Property by the environment name, and returns a list of environments for a given Property that contain the provided name, or all environments if no name is provided.
This func retrieves an environment by ID and returns it, or empty if none was found.
Returns the first environment in the list that matches the name, or nil if no environments match the name.
Check a more in-depth documentation of the edgio/env
package here.
Reference: Edgio Environments REST API documentation reference.
[WIP]
This package groups Edgio Environment Variables specific funcs.
This func returns a new client with the provided parameters, with an access token already set, and the default edgio params values for service, scope and API version (which can be overwritten if needed) to interact with your application's environments.
This func list environment variables for a given Edgio Environment. Edgio's list page size was defaulted to 100 for now, which is the highest value. The idea is to return all environment variables until actual pagination is implemented. Returns a list of environment variables for a given Property or an error if anything goes wrong.
variable.FilterList(params variable.FilterParams) (common.FilteredListResultType[common.Variable], error)
This func filters the list of environment variables for a given Environment by the variable key, and returns a list of environment variables that contain the provided key, or all environment variables if no key is provided.
This func retrieves an environment variable by ID and returns it, or empty if none was found.
This func returns the environment variable that matches the provided key, or nil if no environment variables match the key.
Check a more in-depth documentation of the edgio/variables
package here.
Reference: Edgio Environment Variables REST API documentation reference.
[WIP]
Edgio Cache REST API documentation reference.
[WIP]
Edgio CDN REST API documentation reference.
[WIP]
Edgio Deployment REST API documentation reference.
[WIP]
Edgio TSL REST API documentation reference.
[WIP]
Edgio ACL REST API documentation reference.
[WIP]
Edgio Security Ruleset REST API documentation reference.
[WIP]
Edgio Schemas REST API documentation reference.
[WIP]
Edgio Rate Rules REST API documentation reference.
[WIP]
Edgio Managers Config REST API documentation reference.
[WIP]
Edgio Bot Ruleset REST API documentation reference.
[WIP]
Edgio Known Bots REST API documentation reference.
[WIP]
Edgio Custom Rules REST API documentation reference.
[WIP]
Edgio Managed Rules REST API documentation reference.
[WIP]
Edgio Edgio Rulesets REST API documentation reference.
[WIP]
Edgio Security Apps REST API documentation reference.
There are a few tools we provide alongside with the source code to ease a little bit the burden of following a bunch of patterns and standards we set up, as well as automate some boring processes.
comitizen
: This CLI helps with writting commit messages in a meaningful and standardized way, so that our automation process can use them to properly write our software, changelog. To use it, you just need to run./tools/commitizen-go install
from the repository's root folder. After that, you just need to usegit cz
command instead of the standardgit commit
and follow the cli interactive steps :)
Kudos to all our dear contributors. Without them, nothing would have been possible β€οΈ
Rafael Eduardo Paulin π» π¨ π π€ π π§ π π |
Rafael A π |
Would you like to see your profile here? Take a look on our Code of Conduct and our Contributing docs, and start coding! We would be thrilled to review a PR of yours! π―
All changes made to this module since the start of development can be found either on our release list or on the changelog.
Any planned enhancement to the module will be described and tracked in our project page