46 lines
1.3 KiB
Go
46 lines
1.3 KiB
Go
// Package graph provides a client for using the OtterSpace API.
|
|
//
|
|
// This package provides a client to interact with the OtterSpace API. It includes
|
|
// methods for all API endpoints, and convenience methods for common tasks.
|
|
//
|
|
// This is a simple usage example:
|
|
//
|
|
// package main
|
|
//
|
|
// import (
|
|
// "context"
|
|
// "fmt"
|
|
// "git.dragse.it/anthrove/otter-space-sdk/pkg/models"
|
|
// "git.dragse.it/anthrove/otter-space-sdk/pkg/graph"
|
|
// )
|
|
//
|
|
// func main() {
|
|
// client := graph.NewGraphConnection()
|
|
// err := client.Connect(context.Background(), "your-endpoint", "your-username", "your-password")
|
|
// if err != nil {
|
|
// fmt.Println(err)
|
|
// return
|
|
// }
|
|
// // further usage of the client...
|
|
// }
|
|
package graph
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// OtterSpace provides an interface for interacting with the OtterSpace API.
|
|
// It includes methods for connecting to the API, adding and linking users, posts, and sources,
|
|
// and retrieving information about users and posts.
|
|
type OtterSpace interface {
|
|
|
|
// Connect sets up a connection to the OtterSpace API endpoint using the provided username and password.
|
|
// It returns an error if the connection cannot be established.
|
|
Connect(ctx context.Context, endpoint string, username string, password string) error
|
|
|
|
User
|
|
Tag
|
|
Source
|
|
Post
|
|
}
|