-
Notifications
You must be signed in to change notification settings - Fork 98
Godoc front page #78
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
Godoc front page #78
Conversation
oci.go
Outdated
| The SDK uses pointers for primitive types in many input structs. To aid in the construction of such structs, the SDK provides | ||
| functions that returns a pointer for a given value. For example: | ||
| //Given the struct |
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.
other comments above you put a space after the // before the comment
oci.go
Outdated
| DisplayName *string `mandatory:"false" json:"displayName"` | ||
| DisplayNumber *int `mandatory:"false" json:"dnsNumber"` |
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.
whats a DisplayNumber? Why isn't this dnsNumber?
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.
also, does create vcn really take a dnsNumber param? seems wrong
oci.go
Outdated
| DisplayNumber *int `mandatory:"false" json:"dnsNumber"` | ||
| } | ||
| //We can use the helper functions to build the struct |
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.
same comment re // space
oci.go
Outdated
| Signing custom requests | ||
| The oci-go-sdk exposes a stand-alone signer that can be used to sign custom requests. For example: |
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.
you call it 'sdk' in other places, but oci-go-sdk here. should be consistent
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.
is there a way to link to the signer's entry in the api ref here as well?
oci.go
Outdated
| var request http.Request | ||
| request = ... // some custom request | ||
| //Mandatory headers to be used in the sign process |
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.
same point re // space here and below comments
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.
" sign process" -> " signing process"
| // A predicate that specifies when to use the optional signing headers | ||
| optionalHeadersPredicate := func (r *http.Request) bool { | ||
| return r.Method == http.MethodPost | ||
| } |
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.
why make the user pass this? this is common to OCI signing logic and wouldn't change based on user's code:
defaultGenericHeaders = []string{"date", "(request-target)", "host"}
//Optional headers
optionalHeaders = []string{"content-length", "content-type", "x-content-sha256"}
// A predicate that specifies when to use the optional signing headers
optionalHeadersPredicate := func (r *http.Request) bool {
return r.Method == http.MethodPost
}
oci.go
Outdated
| //Build the signer | ||
| signer := common.RequestSigner(provider, defaultGenericHeaders, optionalHeaders, optionalHeadersPredicate) | ||
| //Signs the request |
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.
based on other tenses in comments, this should be 'Sign the request'
| //Signs the request | ||
| signer.Sign(&request) | ||
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.
i think the example should show making the request, once its signed, too?
oci.go
Outdated
| //Signs the request | ||
| signer.Sign(&request) | ||
| For more information on the signing algorithm refer to: https://tools.ietf.org/html/draft-cavage-http-signatures-08 |
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.
please link to https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/signingrequests.htm instead. it does link to this link you've provided for more info if user needs it, but the TC doc is much more grokable than the spec itself.
oci.go
Outdated
| Polymorphic json requests and responses | ||
| Some operations accept or return polymorphic json objects. The SDK models such objects as an interface. Further the SDK provides |
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.
"The SDK models such objects as an interface" -> "The SDK models such objects as interfaces"
oci.go
Outdated
| fmt.Println("Group's name is:", response.Name) | ||
| Organization of the SDK | ||
| // The CreateIdentityProviderRequest. Takes a CreateIdentityProviderDetails interface as input |
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.
stray period
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.
or maybe not. nevermind
oci.go
Outdated
| // The CreateIdentityProviderRequest. Takes a CreateIdentityProviderDetails interface as input | ||
| rCreate := identity.CreateIdentityProviderRequest{} | ||
| // The CreateSaml2IdentityProviderDetails implement such interface. |
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.
i would be clear that it implements the CreateIdentityProviderDetails interface here
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.
also, did we update the descriptions for interfaces like CreateIdentityProviderDetails to mention the possible structs (subclasses) they can take? So user doesn't have to go searching through whole API reference for something that matches the interface?
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.
not yet I have a task for that. Some services already document that others do not
oci.go
Outdated
| Pagination | ||
| When calling a list operation, the operation will retrieve a page of results. To retrieve more data, call the list operation again |
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.
" call the list operation again passing" -> " call the list operation again, passing"
oci.go
Outdated
| When calling a list operation, the operation will retrieve a page of results. To retrieve more data, call the list operation again | ||
| passing in the value of the most recent response's OpcNextPage as the value of Page in the next list operation call. | ||
| When there is no more data the OpcNextPage field will be nil. For example: https://github.com/oracle/oci-go-sdk/blob/master/example/example_core_test.go#L86 |
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.
"An example of paginating using this logic can be found here: For example: https://github.com/oracle/oci-go-sdk/blob/master/example/example_core_test.go#L86"
oci.go
Outdated
| The SDK has a built-in logging mechanism used internally. The internal logging logic is used to record the raw http | ||
| requests, responses and potential errors when (un)marshalling request and responses. | ||
| To expose debugging logs set the environment variable "OCI_GO_SDK_DEBUG" to "1", or some other non emtpy string. |
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.
"To expose debugging logs " -> "To expose debugging logs,"
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.
typo: emtpy
oci.go
Outdated
| Forward and Backwards Compatibility | ||
| Some response fields are enum-typed. In the future, individual services may return values not covered by existing enums | ||
| for that field. To address this possibility, every enum-type response field is a model as a type that supports any string. |
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.
" is a model as a" -> " is modeled as a"
oci.go
Outdated
| To expose debugging logs set the environment variable "OCI_GO_SDK_DEBUG" to "1", or some other non emtpy string. | ||
| Forward and Backwards Compatibility |
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.
This section is just on Forwards Compat. Title should remove backwards compat part
| Some response fields are enum-typed. In the future, individual services may return values not covered by existing enums | ||
| for that field. To address this possibility, every enum-type response field is a model as a type that supports any string. | ||
| Thus if a service returns a value that is not recognized by your version of the SDK, then the response field will be set to this value. |
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.
what about new subclasses for polymorphic models? should mention that as well
| Each package represents a service. These packages include methods to interact with the service, structs that model | ||
| input and output parameters and a client struct that acts as receiver for the above methods. All code in these packages | ||
| is machine generated. | ||
| Licensing information available at: https://github.com/oracle/oci-go-sdk/blob/master/LICENSE.txt |
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.
'License information is available at ...'
also, https://github.com/oracle/oci-go-sdk/blob/master/LICENSE.txt doesn't have the right '2016, 2018' copyright text in it
| - cmd: internal tools used by the `oci-go-sdk` | ||
| */ | ||
| package oci |
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.
if we add retry functionality for GA, should add a section on it here as well
@shalka fyi
| there are some functions in this package that are meant for user consumption, most of them are meant to be used by the service packages. | ||
| - cmd: internal tools used by the `oci-go-sdk` | ||
| */ |
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.
what about Notifications and Questions or Feedback sections?
|
@jodoglevy We are going to merge this changes as they are, to update master with the lastest godocs, if we need modifications we can tackle them later. |
SCOPE: preview, master
Squashed commit of the following:
commit 7b91e5360be814c245f1ac27c4211abf0897fdc7
Author: Esteban G <esteban.ginez@oracle.com>
Date: Tue Jun 12 09:25:58 2018 -0700
DEX-3649: Hiding details on R1 url
SCOPE: preview, master
Squashed commit of the following:
commit 7b91e5360be814c245f1ac27c4211abf0897fdc7
Author: Esteban G <esteban.ginez@oracle.com>
Date: Tue Jun 12 09:25:58 2018 -0700
DEX-3649: Hiding details on R1 url
This PR adds content to the front page of the godocs page. It covers applicable technical information including: Optional fields, Signer, Pagination, Logging, Polymorphic json, etc. It also includes a brief example on how to get started with SDK, otherwise it references the examples directory or the readme file