Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { APIKey string APIKeySecret string PIN string StateFilePath string // if empty the tokenCredsFile const will be used as path }
Config contains all the values needed by New()
type Wrapper ¶
type Wrapper struct { // wrapped client Client *twittgo.Client // contains filtered or unexported fields }
Wrapper handles the 3-legged OAuth process automatically during its initialization. Must be instanciated with New()
func New ¶
New returns an initialized and ready to used Twitter Wrapper. If err is nil but authorizationURL is not, caller must : 1- transmit the URL to its user, let him authorize the account to be used and recover the PIN verifier code. 2- once the PIN has been recovered, call New again with the correct PIN in Config. Intermediary auth state will be loaded automatically from disk. Only a nil err and authorizationURL mean the client within the wrapper can be used.
func (*Wrapper) GetAuthedUser ¶
GetAuthedUser returns the account currently authenticated
func (*Wrapper) SaveStatus ¶
SaveStatus dump the current auth & requests tokens to disk. Wihtout a restored state, New() will always trigger a new auth process: call it before exiting !