Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc links #363

Merged
merged 7 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static:
# let config = quilkin::config::Config::from_reader(yaml.as_bytes()).unwrap();
# assert_eq!(config.source.get_static_filters().unwrap().len(), 2);
# quilkin::Builder::from(std::sync::Arc::new(config)).validate().unwrap();
}
# }
```

We specify our filter chain in the `.filters` section of the proxy's configuration which has takes a sequence of [FilterConfig](#filter-config) objects. Each object describes all information necessary to create a single filter.
Expand Down
2 changes: 0 additions & 2 deletions docs/src/filters/capture_bytes.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ static:
# quilkin::Builder::from(std::sync::Arc::new(config)).validate().unwrap();
```

`[[TODO: update/link to routing examples once they are complete]]`

### Configuration Options

```yaml
Expand Down
30 changes: 12 additions & 18 deletions docs/src/filters/writing_custom_filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ To extend Quilkin's code with our own custom filter, we need to do the following

1. **Start the proxy**

We can run the proxy in the exact manner as the default Quilkin binary using the [run] function, passing in our custom [FilterFactory].
We can run the proxy in the exact manner as the default Quilkin binary using the [run][runner::run] function, passing in our custom [FilterFactory].
Lets add a main function that does that. Quilkin relies on the [Tokio] async runtime so we need to import that crate and wrap our main function with it.

Add Tokio as a dependency in `Cargo.toml`.
Expand All @@ -122,10 +122,9 @@ To extend Quilkin's code with our own custom filter, we need to do the following
```

Add a main function that starts the proxy.
```no_run
```rust, no_run
// src/main.rs
# use quilkin::filters::{CreateFilterArgs, Filter, Error, FilterFactory};

# struct GreetFilterFactory;
# impl FilterFactory for GreetFilterFactory {
# fn name(&self) -> &'static str {
Expand Down Expand Up @@ -207,9 +206,7 @@ The [Serde] crate is used to describe static YAML configuration in code while [P

```rust
// src/main.rs

# use quilkin::filters::{Filter, ReadContext, ReadResponse, WriteContext, WriteResponse};

struct Greet(String);

impl Filter for Greet {
Expand All @@ -230,7 +227,6 @@ The [Serde] crate is used to describe static YAML configuration in code while [P

```rust
// src/main.rs

# use serde::{Deserialize, Serialize};
# #[derive(Serialize, Deserialize, Debug)]
# struct Config {
Expand All @@ -239,7 +235,6 @@ The [Serde] crate is used to describe static YAML configuration in code while [P
# use quilkin::filters::{CreateFilterArgs, Error, FilterFactory, Filter, ReadContext, ReadResponse, WriteContext, WriteResponse};
# struct Greet(String);
# impl Filter for Greet { }

use quilkin::config::ConfigType;

struct GreetFilterFactory;
Expand Down Expand Up @@ -278,9 +273,9 @@ static:

##### Dynamic Configuration

You might have noticed while adding [static configuration support][anchor-static-config], that the [config][create-filter-args-config] argument passed into our [FilterFactory]
has a [Dynamic][config-type-dynamic] variant.
```ignore
You might have noticed while adding [static configuration support][anchor-static-config], that the [config][CreateFilterArgs::config] argument passed into our [FilterFactory]
has a [Dynamic][ConfigType::dynamic] variant.
```rust, ignore
let greeting = match args.config.unwrap() {
ConfigType::Static(config) => {
serde_yaml::from_str::<Config>(serde_yaml::to_string(config).unwrap().as_str())
Expand Down Expand Up @@ -392,14 +387,13 @@ However, it usually contains a Protobuf equivalent of the filter's static config
}
```

[Filter]: #
[FilterFactory]: #
[filter-factory-name]: #FilterFactory::name
[FilterRegistry]: #
[FilterChain]: #
[runner]: #
[create-filter-args-config]: #CreateFilter::config
[config-type-dynamic]: #ConfigType::Dynamic
[Filter]: https://docs.rs/quilkin/{{version}}/quilkin/filters/trait.Filter.html
[FilterFactory]: https://docs.rs/quilkin/0.1.0/quilkin/filters/trait.FilterFactory.html
[filter-factory-name]: https://docs.rs/quilkin/0.1.0/quilkin/filters/trait.FilterFactory.html#tymethod.name
[FilterRegistry]: https://docs.rs/quilkin/0.1.0/quilkin/filters/struct.FilterRegistry.html
[runner::run]: https://docs.rs/quilkin/0.1.0/quilkin/runner/fn.run.html
[CreateFilterArgs::config]: https://docs.rs/quilkin/0.1.0/quilkin/filters/prelude/struct.CreateFilterArgs.html#structfield.config
[ConfigType::dynamic]: https://docs.rs/quilkin/0.1.0/quilkin/filters/enum.ConfigType.html#variant.Dynamic
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why I think we should move this stuff to rustdoc, it would always go to the correct version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also just use relative links to our local versions of the API docs - since they are published together.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They aren't published together at mdbook build/test time though, so that would fail any linkchecking.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also use a seperate link checker - we don't have to be tied just to mdbook's link checker - then we can check links across the entire documentation set. This will be particularly useful as we will probably end up with links going back and forth between rustdoc and mdbook.

I'm particularly partial to https://github.com/wjdp/htmltest for link checking across an entire website.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #367 to track the discussion!


[anchor-static-config]: #static-configuration
[Filters]: ./filters.md
Expand Down
2 changes: 1 addition & 1 deletion docs/src/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ while also providing the most redundancy and security for your dedicated game se
## What Next?

* Have a look at the [example configurations](https://github.com/googleforgames/quilkin/blob/main/examples) for basic configuration examples.
* Review the [set of filters](./extensions/filters/filters.md) that are available.
* Review the [set of filters](./filters.md) that are available.

---

Expand Down
8 changes: 4 additions & 4 deletions docs/src/xds.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ Quilkin exposes the following metrics around the management servers and its reso
[clapolicy]: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/endpoint/v3/endpoint.proto#config-endpoint-v3-clusterloadassignment-policy
[locality]: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/base.proto#config-core-v3-locality
[socket addresses]: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#config-core-v3-address
[filters-doc]: ./extensions/filters/filters.md
[filters-doc]: ./filters.md
[listener-resource]: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#config-listener-v3-listener
[xds-filters]: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener_components.proto#envoy-v3-api-msg-config-listener-v3-filter
[xds-filter-chain]: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener_components.proto#config-listener-v3-filterchain
[DiscoveryRequest]: https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/discovery.proto#envoy-api-msg-discoveryrequest
[xds-variants]: https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol#variants-of-the-xds-transport-protocol
[filter-protos]: ../proto/quilkin/extensions/filters
[filters-doc]: ./extensions/filters/filters.md
[filter-protos]: https://github.com/googleforgames/quilkin/tree/v0.1.0/proto/quilkin/extensions/filters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 should we point at main, rather than the version? We could add a note in the docs that you would want to choose the release tagged version when importing?

Save us updating the docs on each release?

[filters-doc]: ./filters.md
[xds-endpoint-metadata]: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/base.proto#envoy-v3-api-msg-config-core-v3-metadata
[endpoint-metadata]: ./proxy.md#endpoint-metadata
[endpoint-metadata]: ./proxy.md#endpoint-metadata