Documentation
¶
Index ¶
- type Alias
- type AliasName
- type Api
- func (a *Api) GetContent(token oauthv2.OAuthToken, notepage NotePage) ([]byte, HttpStatusCode, error)
- func (a *Api) GetNotebooks(token oauthv2.OAuthToken) ([]Notebook, HttpStatusCode, error)
- func (a *Api) GetPages(token oauthv2.OAuthToken, section Section) ([]NotePage, HttpStatusCode, error)
- func (a *Api) GetSection(token oauthv2.OAuthToken, id string) (Section, HttpStatusCode, error)
- func (a *Api) GetSections(token oauthv2.OAuthToken, n Notebook) ([]Section, HttpStatusCode, error)
- func (a *Api) SaveNote(t oauthv2.OAuthToken, n NotePage) (string, HttpStatusCode, error)
- func (a *Api) SearchPage(token oauthv2.OAuthToken, q string) ([]NotePage, HttpStatusCode, error)
- type HttpStatusCode
- type NotePage
- type Notebook
- type NotebookName
- type Section
- type SectionName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alias ¶
type Alias struct {
Short string `json:"a"`
Notebook Notebook `json:"n"`
Section Section `json:"s"`
}
Represents a section alias
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) GetContent ¶
func (a *Api) GetContent(token oauthv2.OAuthToken, notepage NotePage) ([]byte, HttpStatusCode, error)
Returns the page content as string
func (*Api) GetNotebooks ¶
func (a *Api) GetNotebooks(token oauthv2.OAuthToken) ([]Notebook, HttpStatusCode, error)
https://docs.microsoft.com/en-us/graph/api/onenote-list-notebooks?view=graph-rest-1.0&tabs=http
func (*Api) GetPages ¶
func (a *Api) GetPages(token oauthv2.OAuthToken, section Section) ([]NotePage, HttpStatusCode, error)
https://docs.microsoft.com/en-us/graph/api/onenote-list-pages?view=graph-rest-1.0
func (*Api) GetSection ¶
func (a *Api) GetSection(token oauthv2.OAuthToken, id string) (Section, HttpStatusCode, error)
Gets the section data by given id https://docs.microsoft.com/en-us/graph/api/section-get?view=graph-rest-1.0&tabs=go
func (*Api) GetSections ¶
func (a *Api) GetSections(token oauthv2.OAuthToken, n Notebook) ([]Section, HttpStatusCode, error)
https://docs.microsoft.com/en-us/graph/api/onenote-list-sections?view=graph-rest-1.0&tabs=http
func (*Api) SaveNote ¶
func (a *Api) SaveNote(t oauthv2.OAuthToken, n NotePage) (string, HttpStatusCode, error)
https://docs.microsoft.com/en-us/graph/api/onenote-post-pages?view=graph-rest-1.0
func (*Api) SearchPage ¶
func (a *Api) SearchPage(token oauthv2.OAuthToken, q string) ([]NotePage, HttpStatusCode, error)
Searchs in all notes https://docs.microsoft.com/en-us/graph/search-query-parameter
type HttpStatusCode ¶
type HttpStatusCode = rest.HttpStatusCode
type NotePage ¶
type NotePage struct {
Section Section
Title string `json:"title"`
Content string
ContentUrl string `json:"contentUrl"`
Links struct {
OneNoteClientURL struct {
Href string `json:"href"`
} `json:"oneNoteClientUrl"`
OneNoteWebURL struct {
Href string `json:"href"`
} `json:"oneNoteWebUrl"`
} `json:"links"`
ParentSection Section `json:"parentSection"`
LastModifiedDateTime time.Time `json:"lastModifiedDateTime"`
}
Represents a note page
type Notebook ¶
type Notebook struct {
ID string `json:"id"`
DisplayName string `json:"displayName"`
SectionsUrl string `json:"sectionsUrl"`
}
Represents a onenote notebook
type NotebookName ¶
type NotebookName string
type Section ¶
type Section struct {
Name string `json:"displayName"`
ID string `json:"id"`
Notebook *Notebook `json:"parentNotebook"`
}
Represents a section in a notebook
type SectionName ¶
type SectionName string