Documentation
¶
Index ¶
- func GetLoginURL(w http.ResponseWriter, r *http.Request) string
- func InitConfig(permissions []string, clientID string, clientSecret string, redirectURL string)
- func SharePost(post *Post, w http.ResponseWriter, r *http.Request) (*http.Response, error)
- type ContentStruct
- type LinkedinProfile
- type Location
- type Position
- type PositionCompany
- type Positions
- type Post
- type VisibilityStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoginURL ¶
func GetLoginURL(w http.ResponseWriter, r *http.Request) string
GetLoginURL provides a state-specific login URL for the user to login to. CAUTION: This must be called before GetProfileData() as this enforces state.
func InitConfig ¶
InitConfig initializes the config needed by the client. permissions is a string of all scopes desired by the user.
Types ¶
type ContentStruct ¶
type ContentStruct struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
SubmittedURL string `json:"sumbitted-url,omitempty"`
SubmittedImageURL string `json:"submitted-image-url,omitempty"`
}
ContentStruct represents a collection of fields describing the shared content.
type LinkedinProfile ¶
type LinkedinProfile struct {
// ProfileID represents the Unique ID every Linkedin profile has.
ProfileID string `json:"id"`
// FirstName represents the user's first name.
FirstName string `json:"first_name"`
// LastName represents the user's last name.
LastName string `json:"last-name"`
// MaidenName represents the user's maiden name, if they have one.
MaidenName string `json:"maiden-name"`
// FormattedName represents the user's formatted name, based on locale.
FormattedName string `json:"formatted-name"`
// PhoneticFirstName represents the user's first name, spelled phonetically.
PhoneticFirstName string `json:"phonetic-first-name"`
// PhoneticFirstName represents the user's last name, spelled phonetically.
PhoneticLastName string `json:"phonetic-last-name"`
// Headline represents a short, attention grabbing description of the user.
Headline string `json:"headline"`
// Location represents where the user is located.
Location Location `json:"location"`
// Industry represents what industry the user is working in.
Industry string `json:"industry"`
CurrentShare string `json:"current-share"`
// NumConnections represents the user's number of connections, up to a maximum of 500.
// The user's connections may be over this, however it will not be shown. (i.e. 500+ connections)
NumConnections int `json:"num-connections"`
// IsConnectionsCapped represents whether or not the user's connections are capped.
IsConnectionsCapped bool `json:"num-connections-capped"`
// Summary represents a long-form text description of the user's capabilities.
Summary string `json:"summary"`
// Specialties is a short-form text description of the user's specialties.
Specialties string `json:"specialties"`
// Positions is a Positions struct that describes the user's previously held positions.
Positions Positions `json:"positions"`
// PictureURL represents a URL pointing to the user's profile picture.
PictureURL string `json:"picture-url"`
// EmailAddress represents the user's e-mail address, however you must specify 'r_emailaddress'
// to be able to retrieve this.
EmailAddress string `json:"email-address"`
}
LinkedinProfile is used within this package as it is less useful than native types.
func GetProfileData ¶
func GetProfileData(w http.ResponseWriter, r *http.Request) (*LinkedinProfile, error)
GetProfileData gather's the user's Linkedin profile data and returns it as a pointer to a LinkedinProfile struct. CAUTION: GetLoginURL must be called before this, as GetProfileData() has a state check.
type Position ¶
type Position struct {
// ID represents a unique ID representing the position
ID string
// Title represents a user's position's title, for example Jeff Bezos's title would be 'CEO'
Title string
// Summary represents a short description of the user's position.
Summary string
// StartDate represents when the user's position started.
StartDate string
// EndDate represents the user's position's end date, if any.
EndDate string
// IsCurrent represents if the position is currently held or not.
// If this is false, EndDate will not be returned, and will therefore equal ""
IsCurrent bool
// Company represents the Company where the user is employed.
Company PositionCompany
}
Position represents a job held by the authorized user.
type PositionCompany ¶
type PositionCompany struct {
// ID represents a unique ID representing the company
ID string
// Name represents the name of the company
Name string
// Type represents the type of the company, either 'public' or 'private'
Type string
// Industry represents which industry the company is in.
Industry string
// Ticker represents the stock market ticker symbol of the company.
// This will be blank if the company is privately held.
Ticker string
}
PositionCompany represents a company that is described within a user's Profile. This is different from Company, which fully represents a company's data.
type Positions ¶
type Positions struct {
// contains filtered or unexported fields
}
Positions represents the result given by json:"positions"
type Post ¶
type Post struct {
Content ContentStruct `json:"content,omitempty"`
Comment string `json:"comment"`
Visibility VisibilityStruct `json:"visibility"`
}
Post represents a post that one shares on a Linkedin profile, not a POST request. To validate posts, call isValidPost() on one.
type VisibilityStruct ¶
type VisibilityStruct struct {
// Code is the only field specified in the documentation.
// must be either "anyone" or "connections-only"
Code string `json:"code"`
}
VisibilityStruct represents the visibility information about the shared post.