-
Notifications
You must be signed in to change notification settings - Fork 247
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
Simplify ConsistencyLevel and CosmosStruct #88
Conversation
//Account name: localhost:<port> | ||
//Account key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== | ||
let auth_token = AuthorizationToken::new_master( | ||
"C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", | ||
).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the unwrap? I don't believe we can. Can you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, just realized that this was a magic string for the Cosmos DB emulator account key, I thought this was a leftover from debugging. Ignore my silliness 🙃
Small suggestion, feel free to ignore if out of scope for the PR - document and refer to the docs for the emulator. Maybe move that connection string to a const. Might avoid some confusion for the uninitiated like myself.
} | ||
|
||
impl CloudLocation { | ||
/// Consumes the location, returning a base URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor - but doesn't consume I believe
This is great work ❤️ . I think we probably want to merge #79 first since many modifications are probably going to create conflicts. |
@thomastaylor312 and I are looking into simplifying the
cosmos
crate. This PR contains changes to two types that are indicative of the larger changes we would like to make.In general these changes favor concrete types over traits. Some additional changes I'd like to make include but are not limited to:
CosmosClient
trait and and renameCosmosStruct
toCosmosClient
.hyper_client
field ofCosmosStruct
toclient
and make it aBox<dyn Client>
. This is somewhat dependent on other work to abstract the client usage so implementations are not dependent on a particular http implementation.CosmosClient
(akaCosmosStruct
)