gogemwikiapi

package module
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 16 Imported by: 1

README

goGEM-WikiAPI

The goGEM Module will enable iGEM Teams to compleatly design and maintain their Wiki via a WordPress instance.

This Module contains the functions that enable communications with the iGEM-Servers.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletePage

func DeletePage(pageurl string, year int, client *http.Client) error

func GetFileUrl

func GetFileUrl(file_overview_url string, client *http.Client) (string, error)

func Login

func Login(username, password, loginUrl string) (*http.Client, error)

Login requests the loginURL, which should be a defined constant that leads to the first link in the iGEM login chain. Input : username, password, loginURL. Output: Pointer to Client with active session, if login was successful, otherwise an error will be returned.

func Logout

func Logout(client *http.Client, logoutUrl string) error

Logout logs the user out of the iGEM website. logoutURL is the URL to the first page in the logout chain. Input: Pointer to Client, logoutURL. Output: No return value, but an error will be returned if something went wrong.

func QueryPages

func QueryPages(prefixURL, teamname, offset string, client *http.Client) ([]string, error)

TODO: remove hardcoded stuff

func Redirect

func Redirect(client *http.Client, year int, teamname, source, target string) (string, error)

func Upload

func Upload(client *http.Client, year int, teamname, pathToFile, offset string, file, force bool) (string, error)

Upload is the wrapper for the whole upload process. Input: Session, Wiki year, Teamname with spaces as underscore, filepath to the file to upload, offset, if it is a file(media files etc.), and if already uploaded files should be overwritten (already uploaded is determined by a hash compare). Output: String containing the URL to the uploaded page / the file overview page, or an error if something went wrong.

Types

This section is empty.

Jump to

Keyboard shortcuts

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