Categorygithub.com/kallydev/telegraph-go
modulepackage
1.0.0
Repository: https://github.com/kallydev/telegraph-go.git
Documentation: pkg.go.dev

# README

Telegraph Go

Golang Telegraph API SDK. "Nobody knows more about Telegraph than I do!" Trump waved and said excitedly.

Guide

Installation

go get github.com/kallydev/telegraph-go

Example

package main

import (
    "fmt"
    "github.com/kallydev/telegraph-go"
    "log"
)

func main() {
 	client, err := telegraph.NewClient("", nil)
 	if err != nil {
 		log.Panicln(err)
 	}
 	account, err := client.CreateAccount("telegraph-go", &telegraph.CreateAccountOption{
 		AuthorName: "TelegraphGo",
 		AuthorURL:  "https://github.com/kallydev",
 	})
 	if err != nil {
 		log.Panicln(err)
 	}
 	client.AccessToken = account.AccessToken
 	paths, err := client.Upload([]string{
        "public/banner.png",
    })
 	if err != nil {
 		log.Panicln(err)
 	}
 	page, err := client.CreatePage("Telegraph-Go Example", []telegraph.Node{
 		telegraph.NodeElement{
 			Tag: "p",
 			Children: []telegraph.Node{
 				"hello world",
 				telegraph.NodeElement{
 					Tag: "img",
 					Attrs: map[string]string{
 						"src":  paths[0],
 						"attr": "Banner",
 					},
 				},
 			},
 		},
 	}, &telegraph.CreatePageOption{
 		ReturnContent: true,
 	})
 	if err != nil {
 		log.Panicln(err)
 	}
    fmt.Println(page)
}

License

Copyright (c) KallyDev. All rights reserved.

Licensed under the MIT license.

# Functions

No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author