Documentation
¶
Overview ¶
Package dontgo is an unofficial client for using dontpad.com with go. It allows you to write and read in the dontpad website. You might want to use this package as a temporary way of applying persistence to your variables. Do not ever use this in production. First because this is unofficial and there is no guarantee that dontpad will not change the way they store the contents. And second because anyone is able to overwrite the identifiers without any authorization. You can also access what you wrote on the website dontpad.com/{identifier}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Append ¶
Append function is essentially the same as the Write function, excepts it does not overwrite the contents, if there is any, using the same identifier. It appends to the end of the previous content.
func Read ¶
Read function gets an identifier and returns a string with its contents. You can also access it on dontpad.com/{identifier}. We do not return an error because we want you to be able to access it directly as value, if there are any errors, keep in mind that it will panic. If you don't want this to happen, use ReadNoPanic instead.
func ReadNoPanic ¶
ReadNoPanic function is essentially the same as Read function excepts it returns an error together with the value, allowing you to treat it.
func Write ¶
Write function receives a identifier string and an empty interface content, which contains what you want to write in the identifier page. You can pass pretty much anything, if it is any type of int, float or bool we will simply convert it into a string. If it is anything else, we will convert it to json with the builtin json package. If it can not convert, we will return its error so you can treat it. This function overwrites any previous content using the same identifier.
Types ¶
This section is empty.