Documentation ¶
Index ¶
- Constants
- Variables
- func FileBasedTokenPersistence(filename string) func(w http.ResponseWriter, r *http.Request) ContextWithTokenPersistence
- func ServeLocalhost(port int, clientID string, clientSecret string)
- type Basecamp
- func (bc *Basecamp) ApiReverseProxy(w http.ResponseWriter, r *http.Request)
- func (bc *Basecamp) Authenticate(w http.ResponseWriter, r *http.Request)
- func (bc *Basecamp) Project(ctx ContextWithTokenPersistence, account int, project int) (Project, error)
- func (bc *Basecamp) Projects(ctx ContextWithTokenPersistence, account int) ([]Project, error)
- func (bc *Basecamp) Todo(ctx ContextWithTokenPersistence, account int, project int, todo int) (Todo, error)
- func (bc *Basecamp) TodoList(ctx ContextWithTokenPersistence, account int, project int, todolist int) (Todo, error)
- func (bc *Basecamp) TodoList_Groups(ctx ContextWithTokenPersistence, account int, project int, todolist int) ([]Todo, error)
- func (bc *Basecamp) TodoSet(ctx ContextWithTokenPersistence, account int, project int, todoset int64) (TodoSet, error)
- func (bc *Basecamp) TodoSet_Lists(ctx ContextWithTokenPersistence, account int, project int, todoset int64) ([]Todo, error)
- func (bc *Basecamp) Todos(ctx ContextWithTokenPersistence, account int, project int, todolist int) ([]Todo, error)
- func (bc *Basecamp) VerifyRequest(w http.ResponseWriter, r *http.Request)
- type ContextWithTokenPersistence
- func ReverseProxyRequestContext(w http.ResponseWriter, r *http.Request) ContextWithTokenPersistence
- func TokenFile(ctx context.Context, filename string) ContextWithTokenPersistence
- func TokenStoredInCookieContext(ctx context.Context, w http.ResponseWriter, r *http.Request) ContextWithTokenPersistence
- type Dock
- type Project
- type Todo
- type TodoSet
Constants ¶
View Source
const (
BasecampApiRootURL = "https://3.basecampapi.com"
)
View Source
const TokenCookie = "BC3-API-Token"
Variables ¶
View Source
var Endpoint = oauth2.Endpoint{
AuthURL: "https://launchpad.37signals.com/authorization/new",
TokenURL: "https://launchpad.37signals.com/authorization/token",
}
Functions ¶
func FileBasedTokenPersistence ¶
func FileBasedTokenPersistence(filename string) func(w http.ResponseWriter, r *http.Request) ContextWithTokenPersistence
func ServeLocalhost ¶
ServeLocalhost configures and starts a HTTP server on localhost which can be used to authenticate and query BC. Capable of handling a single BC session, and assumes the redirect URL to be set as http://localhost:<port>/verify
Types ¶
type Basecamp ¶
type Basecamp struct { TokenPersitence func(w http.ResponseWriter, r *http.Request) ContextWithTokenPersistence // contains filtered or unexported fields }
func NewByOauth ¶
func (*Basecamp) ApiReverseProxy ¶
func (bc *Basecamp) ApiReverseProxy(w http.ResponseWriter, r *http.Request)
func (*Basecamp) Authenticate ¶
func (bc *Basecamp) Authenticate(w http.ResponseWriter, r *http.Request)
func (*Basecamp) Projects ¶
func (bc *Basecamp) Projects(ctx ContextWithTokenPersistence, account int) ([]Project, error)
func (*Basecamp) TodoList_Groups ¶
func (*Basecamp) TodoSet_Lists ¶
func (*Basecamp) VerifyRequest ¶
func (bc *Basecamp) VerifyRequest(w http.ResponseWriter, r *http.Request)
type ContextWithTokenPersistence ¶
type ContextWithTokenPersistence interface { context.Context oauth2.TokenSource SetToken(*oauth2.Token) }
func ReverseProxyRequestContext ¶
func ReverseProxyRequestContext(w http.ResponseWriter, r *http.Request) ContextWithTokenPersistence
func TokenStoredInCookieContext ¶
func TokenStoredInCookieContext(ctx context.Context, w http.ResponseWriter, r *http.Request) ContextWithTokenPersistence
type Project ¶
type Project struct { ID int `json:"id"` Status string `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Name string `json:"name"` Description string `json:"description"` Purpose string `json:"purpose"` ClientsEnabled bool `json:"clients_enabled"` BookmarkURL string `json:"bookmark_url"` URL string `json:"url"` AppURL string `json:"app_url"` Dock []*Dock `json:"dock"` }
func (*Project) GetTodoSet ¶
type Todo ¶
type Todo struct { ID int64 `json:"id"` Status string `json:"status"` VisibleToClients bool `json:"visible_to_clients"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Title string `json:"title"` InheritsStatus bool `json:"inherits_status"` Type string `json:"type"` URL string `json:"url"` AppURL string `json:"app_url"` BookmarkURL string `json:"bookmark_url"` SubscriptionURL string `json:"subscription_url"` CommentsCount int `json:"comments_count"` CommentsURL string `json:"comments_url"` Position int `json:"position"` Parent struct { ID int64 `json:"id"` Title string `json:"title"` Type string `json:"type"` URL string `json:"url"` AppURL string `json:"app_url"` } `json:"parent"` Bucket struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` } `json:"bucket"` Creator struct { ID int `json:"id"` AttachableSgid string `json:"attachable_sgid"` Name string `json:"name"` EmailAddress string `json:"email_address"` PersonableType string `json:"personable_type"` Title string `json:"title"` Bio string `json:"bio"` Location interface{} `json:"location"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Admin bool `json:"admin"` Owner bool `json:"owner"` Client bool `json:"clietime"` Employee bool `json:"employee"` TimeZone string `json:"time_zone"` AvatarURL string `json:"avatar_url"` Company struct { ID int `json:"id"` Name string `json:"name"` } `json:"company"` } `json:"creator"` Description string `json:"description"` Completed bool `json:"completed"` CompletedRatio string `json:"completed_ratio"` Name string `json:"name"` TodosURL string `json:"todos_url"` GroupsURL string `json:"groups_url"` AppTodosURL string `json:"app_todos_url"` }
type TodoSet ¶
type TodoSet struct { ID int64 `json:"id"` Status string `json:"status"` VisibleToClients bool `json:"visible_to_clients"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Title string `json:"title"` InheritsStatus bool `json:"inherits_status"` Type string `json:"type"` URL string `json:"url"` AppURL string `json:"app_url"` BookmarkURL string `json:"bookmark_url"` Position int `json:"position"` Bucket struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` } `json:"bucket"` Creator struct { ID int `json:"id"` AttachableSgid string `json:"attachable_sgid"` Name string `json:"name"` EmailAddress string `json:"email_address"` PersonableType string `json:"personable_type"` Title string `json:"title"` Bio string `json:"bio"` Location interface{} `json:"location"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Admin bool `json:"admin"` Owner bool `json:"owntime"` Client bool `json:"client"` Employee bool `json:"employee"` TimeZone string `json:"time_zone"` AvatarURL string `json:"avatar_url"` Company struct { ID int `json:"id"` Name string `json:"name"` } `json:"company"` } `json:"creator"` Completed bool `json:"completed"` CompletedRatio string `json:"completed_ratio"` Name string `json:"name"` TodolistsCount int `json:"todolists_count"` TodolistsURL string `json:"todolists_url"` AppTodoslistsURL string `json:"app_todoslists_url"` }
Click to show internal directories.
Click to hide internal directories.