Skip to content

hznoob/go-gitbook-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-gitbook-api

GitBook API client in GO (golang)

Documentation

See GoDoc for automatically generated API documentation.

Check out the examples below for quick and simple ways to start.

Simple Example

package main

import (
    "fmt"
    "github.com/GitbookIO/go-gitbook-api"
)

func main() {
    // Make API client
    api := gitbook.NewAPI(gitbook.APIOptions{})

    // Get book
    book, err := api.Book.Get("gitbookio/javascript")

    // Print results
    fmt.Printf("book = %q\n", book)
    fmt.Printf("error = %q\n", err)
}

Advanced Example

package main

import (
    "fmt"
    "github.com/GitbookIO/go-gitbook-api"
)

func main() {
    // Make API client
    api := gitbook.NewAPI(gitbook.APIOptions{
        // Custom host instead of "https://www.gitbook.io"
        Host: "http://localhost:5000",

        // Hit API with a specific user
        Username: "username",
        Password: "token or password",
    })

    // Get book
    book, err := api.Book.Get("gitbookio/javascript")

    // Print results
    fmt.Printf("book = %q\n", book)
    fmt.Printf("error = %q\n", err)
}

About

GitBook API client in GO (golang)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published