Documentation ¶
Index ¶
- Constants
- Variables
- type HomeData
- type OAuthAccessToken
- type OAuthGrant
- type Service
- func (s *Service) Connect(w http.ResponseWriter, r *http.Request, params api.ConnectParams) *api.Response
- func (s *Service) GetEvents(w http.ResponseWriter, r *http.Request) *api.Response
- func (s *Service) GetHomePage(w http.ResponseWriter, r *http.Request) *api.Response
- func (s *Service) ImportSTIX(w http.ResponseWriter, r *http.Request) *api.Response
Constants ¶
View Source
const ( NOTION_URL = "https://www.notion.so/" NOTION_OAUTH_URL = "https://api.notion.com/v1/oauth/token" ErrCancel = "internal server error caused by user cancellation" ErrOAuthGrant = "internal server error caused by oauth grant content" ErrMissingToken = "internal server error caused by missing oauth token" ErrTokenRequest = "internal server error caused by oauth request to Notion API" ErrTokenDecode = "internal server error caused by decoding oauth token response" ErrImportSTIX = "internal server error caused by importing STIX data to Notion" )
Variables ¶
View Source
var ( ErrValueTooLong = "cookie value too long" ErrInvalidValue = "invalid cookie value" )
Functions ¶
This section is empty.
Types ¶
type OAuthAccessToken ¶
type OAuthAccessToken struct { AccessToken string `json:"access_token,omitempty"` WorkspaceID string `json:"workspace_id,omitempty"` WorkspaceName string `json:"workspace_name,omitempty"` WorkspaceIcon string `json:"workspace_icon,omitempty"` BotID string `json:"bot_id,omitempty"` DuplicatedTemplateID string `json:"duplicated_template_id,omitempty"` }
type OAuthGrant ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents a service that handles integration setup and other operations.
func New ¶
func New(repo notionstix.Repository, redirectURI string, oauthClientID string, oauthClientSecret string, cookieSecret string, store notionstix.Store) *Service
New creates a new instance of the Service.
func (*Service) Connect ¶
func (s *Service) Connect(w http.ResponseWriter, r *http.Request, params api.ConnectParams) *api.Response
Connect handles the connection request from the client. The access token is then used to redirect the client to the Notion URL. If any errors occur during the process, appropriate error responses are returned.
func (*Service) GetHomePage ¶
func (*Service) ImportSTIX ¶
Click to show internal directories.
Click to hide internal directories.