notionion

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2023 License: Unlicense Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const DROP = "DROP"
View Source
const FORWARD = "FORWARD"
View Source
const ON = "ON"
View Source
const REQUEST = "Request"
View Source
const RESPONSE = "Response"

Variables

This section is empty.

Functions

func ChangeRequestButtons

func ChangeRequestButtons(client *notionapi.Client, pageid string, nForward notionapi.ToDoBlock, nDrop notionapi.ToDoBlock) error

ChangeRequestButton: change request buttons appearance

func ClearRequestCode

func ClearRequestCode(client *notionapi.Client, codeBlockID notionapi.BlockID) (notionapi.Block, error)

ClearRequestCode: make the code section empty

func ClearResponseCode

func ClearResponseCode(client *notionapi.Client, codeBlockID notionapi.BlockID) (notionapi.Block, error)

ClearResponseCode: make the code section empty

func DisableRequestButtons

func DisableRequestButtons(client *notionapi.Client, pageid string) error

DisableRequestButtons: print request buttons as disabled

func EnableRequestButtons

func EnableRequestButtons(client *notionapi.Client, pageid string) error

EnableRequestButtons: print request buttons as available (uncheck them also)

func GetCodeBlockByName

func GetCodeBlockByName(children notionapi.Blocks, name string) (requestCodeBlock notionapi.CodeBlock, err error)

GetCodeBlockByName: Obtain the code block object under the section specified by name (name={"Request","Response"})

func GetProxyStatus

func GetProxyStatus(children notionapi.Blocks) (bool, error)

GetProxyStatus: get proxy status from page's blocks

func GetRequestBlock

func GetRequestBlock(children notionapi.Blocks) (requestBlock notionapi.Heading2Block, err error)

GetRequestBlock: retrieve "Request" block from page's blocks

func GetRequestButtonsColumnBlock

func GetRequestButtonsColumnBlock(children notionapi.Blocks) (buttonsBlock notionapi.ColumnListBlock, err error)

GetRequestButtonsColumnBlock: retrieve buttons within request block (column list block)

func GetRequestCodeBlock

func GetRequestCodeBlock(children notionapi.Blocks) (requestCodeBlock notionapi.CodeBlock, err error)

GetRequestCodeBlock: Obtain the code block object under the request heading

func GetResponseBlock

func GetResponseBlock(children notionapi.Blocks) (responseBlock notionapi.Heading2Block, err error)

GetResponseBlock: retrieve "Response" block from page's blocks

func GetResponseCodeBlock

func GetResponseCodeBlock(children notionapi.Blocks) (requestCodeBlock notionapi.CodeBlock, err error)

GetResponseCodeBlock: Obtain the code block object under the response heading

func ListenDropButton

func ListenDropButton(client *notionapi.Client, pageid string, stopchan chan struct{}, action chan<- string)

ListenDropButton: function that constantly check the drop button status to see if it is checked. Update channels consequently

func ListenForwardButton

func ListenForwardButton(client *notionapi.Client, pageid string, stopchan chan struct{}, action chan<- string)

ListenForwardButton: function that constantly check the forward button status to see if it is checked. Update channels consequently

func ProxyRequestHTTPHandler added in v0.0.2

func ProxyRequestHTTPHandler(client *notionapi.Client, pageid string, codeReq notionapi.CodeBlock, codeResp notionapi.CodeBlock) (h goproxy.ReqHandler)

ProxyRequestHTTPHandler: Proxy handler sending request to notion page

func ProxyRequestHTTPSHandler added in v0.0.2

func ProxyRequestHTTPSHandler() func(session *gomitmproxy.Session) (*http.Request, *http.Response)

ProxyRequestHTTPSHandler:

func ProxyResponseHTTPHandler added in v0.0.2

func ProxyResponseHTTPHandler(client *notionapi.Client, pageid string, codeResp notionapi.CodeBlock) (h goproxy.RespHandler)

ProxyResponseHTTPHandler: Proxy handler sending response to notion page

func RequestDropButtonStatus

func RequestDropButtonStatus(client *notionapi.Client, pageid string) (checked bool, err error)

RequestDropButtonStatus: check if drop button is checked

func RequestForwardButtonStatus

func RequestForwardButtonStatus(client *notionapi.Client, pageid string) (checked bool, err error)

RequestForwardButtonStatus: check if forward button is checked

func RequestProxyPageChildren

func RequestProxyPageChildren(client *notionapi.Client, pageid string) (childrenBlocks notionapi.Blocks, err error)

RequestProxyPageChildren: Returns the children block of the Listener page

func RequestProxyStatus

func RequestProxyStatus(client *notionapi.Client, pageid string) (active bool, err error)

RequestProxyStatus: request notion api to determine if proxy is active

func RequestRequestButtonByName

func RequestRequestButtonByName(client *notionapi.Client, pageid string, name string) (button notionapi.ToDoBlock, err error)

RequestRequestButtonByName:return specific to_do block within "request" block is checked. name: {"FORWARD", "DROP"}

func RequestRequestCodeContent

func RequestRequestCodeContent(client *notionapi.Client, pageid string) (request string, err error)

RequestCodeBlock: Obtain the content of code block object under the request heading

func UpdateCodeContent

func UpdateCodeContent(client *notionapi.Client, codeBlockID notionapi.BlockID, content string) (notionapi.Block, error)

UpdateCodeContent: update code block with content

func WaitAction

func WaitAction(client *notionapi.Client, pageid string) string

WaitAction: If we enter this function, the request is in the notion page and the user is treated it. We are waiting for the user check neither FORWARD or DROP.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL