ips

package module
v0.0.0-...-7ee62d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2019 License: MIT Imports: 11 Imported by: 0

README

go-ips

GoDoc

go-ips is a Go client library for accessing the Invision Community APIs.

Disclaimer

🚧 The library is under construction, actually only System API category is implemented 🚧

Usage

import "github.com/w3st3ry/go-ips"

Then checkout examples folder to see some examples about implementation.

Roadmap

  • Implement the other services (Downloads, Pages, Forums, Gallery, Calendar, Blogs, Commerce, Converter)
  • Handle and wrap API exceptions
  • Add some tests to run over TravisCI
  • Add some doc on all exposed functions

Report a bug

Feel free to open an issue directly on this repository /w more informations as possible

Hacking

Feel free to open a PR with suggested changes and argumentation 🚀

License

This library is distributed under the MIT license found in the LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	System *SystemService
	Forums *ForumsService
	// contains filtered or unexported fields
}

func NewClientWithAPIKey

func NewClientWithAPIKey(communityURL, apiKey string) *Client

func NewClientWithOAuth

func NewClientWithOAuth(communityURL string, httpClient *http.Client) *Client

type ForumsService

type ForumsService service

type HelloResponse

type HelloResponse struct {
	CommunityName string `json:"communityName"`
	CommunityURL  string `json:"communityUrl"`
	IPSVersion    string `json:"ipsVersion"`
}

type PaginationOptions

type PaginationOptions struct {
	Page    int `url:"page,omitempty"`
	PerPage int `url:"perPage,omitempty"`
}

type PaginationResponse

type PaginationResponse struct {
	Page         int `json:"page"`
	PerPage      int `json:"perPage"`
	TotalResults int `json:"totalResults"`
	TotalPages   int `json:"totalPages"`
}

type SystemAuthorizedUserEmailResponse

type SystemAuthorizedUserEmailResponse struct {
	Email string `json:"email"`
}

type SystemAuthorizedUserResponse

type SystemAuthorizedUserResponse struct {
	SystemCommonMemberObject
}

type SystemAuthorizedUserService

type SystemAuthorizedUserService SystemService

func (*SystemAuthorizedUserService) Me

func (*SystemAuthorizedUserService) MeEmail

type SystemClubsContentTypesParameters

type SystemClubsContentTypesParameters struct {
	MemberID int `url:"memberId"`
}

type SystemClubsFetchParameters

type SystemClubsFetchParameters struct {
	Owner int `url:"owner"`
	SystemClubsUpdateParameters
}

type SystemClubsListResponse

type SystemClubsListResponse struct {
	PaginationResponse
	Results []SystemClubsObject `json:"results"`
}

type SystemClubsMembersParameters

type SystemClubsMembersParameters struct {
	ID     int `url:"id"`
	Status int `url:"status"`
}

type SystemClubsMembersResponse

type SystemClubsMembersResponse struct {
	Owner      SystemCommonMemberObject   `json:"owner"`
	Members    []SystemCommonMemberObject `json:"members"`
	Leaders    []SystemCommonMemberObject `json:"leaders"`
	Moderators []SystemCommonMemberObject `json:"moderators"`
}

type SystemClubsNodesObject

type SystemClubsNodesObject struct {
	ID          int         `json:"id"`
	Name        string      `json:"name"`
	URL         string      `json:"url"`
	Class       string      `json:"class"`
	Permissions interface{} `json:"permissions"`
}

type SystemClubsNodesParameters

type SystemClubsNodesParameters struct {
	ID     int `url:"id"`
	Status int `url:"status"`
}

type SystemClubsNodesResponse

type SystemClubsNodesResponse struct {
	Nodes []SystemClubsNodesObject `json:"nodes"`
}

type SystemClubsObject

type SystemClubsObject struct {
	SystemClubsMembersResponse
	ID              int                       `json:"id"`
	Name            string                    `json:"name"`
	URL             string                    `json:"url"`
	Type            string                    `json:"type"`
	Approved        bool                      `json:"approved"`
	Created         time.Time                 `json:"created"`
	MemberCount     int                       `json:"memberCount"`
	Photo           *string                   `json:"photo"`
	Paid            bool                      `json:"paid"`
	Featured        bool                      `json:"featured"`
	Location        interface{}               `json:"location"`
	About           string                    `json:"about"`
	LastActivity    time.Time                 `json:"lastActivity"`
	ContentCount    int                       `json:"contentCount"`
	CoverPhotoURL   *string                   `json:"coverPhotoUrl"`
	CoverOffset     string                    `json:"coverOffset"`
	CoverPhotoColor string                    `json:"coverPhotoColor"`
	FieldValues     []SystemCommonFieldObject `json:"fieldValues"`
	Nodes           []SystemClubsNodesObject  `json:"nodes"`
	JoiningFee      interface{}               `json:"joiningFee"`
	RenewalTerm     interface{}               `json:"renewalTerm"`
}

type SystemClubsService

type SystemClubsService SystemService

func (*SystemClubsService) Create

func (*SystemClubsService) CreateMember

func (*SystemClubsService) Delete

func (s *SystemClubsService) Delete(clubID int) (*http.Response, error)

func (*SystemClubsService) DeleteMember

func (s *SystemClubsService) DeleteMember(clubID, memberID int) (*http.Response, error)

func (*SystemClubsService) DeleteNode

func (s *SystemClubsService) DeleteNode(nodeID int) (*http.Response, error)

func (*SystemClubsService) Fetch

func (s *SystemClubsService) Fetch(clubID int) (*SystemClubsObject, *http.Response, error)

func (*SystemClubsService) List

func (*SystemClubsService) ListMembers

func (s *SystemClubsService) ListMembers(clubID int) (*SystemClubsMembersResponse, *http.Response, error)

func (*SystemClubsService) ListNodes

func (*SystemClubsService) Update

type SystemClubsUpdateParameters

type SystemClubsUpdateParameters struct {
	Name        string      `url:"name"`
	About       string      `url:"about,omitempty"`
	Type        string      `url:"type,omitempty"`
	Approved    bool        `url:"approved,omitempty"`
	Featured    bool        `url:"featured,omitempty"`
	Lat         float64     `url:"lat,omitempty"`
	Long        float64     `url:"long,omitempty"`
	JoiningFee  interface{} `url:"joiningFee,omitempty"`
	RenewalTerm interface{} `url:"renewalTerm,omitempty"`
}

type SystemCommonContentTypesObject

type SystemCommonContentTypesObject struct {
	ContentTypes []string `json:"contenttypes"`
}

type SystemCommonFieldGroupObject

type SystemCommonFieldGroupObject struct {
	Name   string                    `json:"name"`
	Fields []SystemCommonFieldObject `json:"fields"`
}

type SystemCommonFieldObject

type SystemCommonFieldObject struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type SystemCommonMemberObject

type SystemCommonMemberObject struct {
	ID            int    `json:"id"`
	Name          string `json:"name"`
	Title         string `json:"title"`
	Timezone      string `json:"timezone"`
	FormattedName string `json:"formattedName"`
	IPAddress     string `json:"ipAddress"`
	PrimaryGroup  struct {
		ID            int    `json:"id"`
		Name          string `json:"name"`
		FormattedName string `json:"formattedName"`
	} `json:"primaryGroup"`
	SecondaryGroups []struct {
		ID            int    `json:"id"`
		Name          string `json:"name"`
		FormattedName string `json:"formattedName"`
	} `json:"secondaryGroups"`
	Email                 string                         `json:"email"`
	Joined                time.Time                      `json:"joined"`
	RegistrationIPAddress string                         `json:"registrationIpAddress"`
	WarningPoints         int                            `json:"warningPoints"`
	ReputationPoints      int                            `json:"reputationPoints"`
	PhotoURL              string                         `json:"photoUrl"`
	PhotoURLIsDefault     bool                           `json:"photoUrlIsDefault"`
	CoverPhotoURL         string                         `json:"coverPhotoUrl"`
	ProfileURL            *string                        `json:"profileUrl"`
	Validating            bool                           `json:"validating"`
	Posts                 int                            `json:"posts"`
	LastActivity          *time.Time                     `json:"lastActivity"`
	LastVisit             *time.Time                     `json:"lastVisit"`
	LastPost              *time.Time                     `json:"lastPost"`
	ProfileViews          int                            `json:"profileViews"`
	Birthday              string                         `json:"birthday"`
	CustomFields          []SystemCommonFieldGroupObject `json:"customFields"`
}

type SystemGroupsListResponse

type SystemGroupsListResponse struct {
	PaginationResponse
	Results []SystemGroupsObject `json:"results"`
}

type SystemGroupsObject

type SystemGroupsObject struct {
	ID            int    `json:"id"`
	Name          string `json:"name"`
	FormattedName string `json:"formattedName"`
}

type SystemGroupsService

type SystemGroupsService SystemService

func (*SystemGroupsService) Delete

func (s *SystemGroupsService) Delete(groupID int) (*http.Response, error)

func (*SystemGroupsService) Fetch

func (s *SystemGroupsService) Fetch(groupID int) (*SystemGroupsObject, *http.Response, error)

func (*SystemGroupsService) List

type SystemMembersCreateParameters

type SystemMembersCreateParameters struct {
	Name                  string                 `url:"name"`
	Email                 string                 `url:"email"`
	Password              string                 `url:"password"`
	Group                 int                    `url:"group"`
	RegistrationIPAddress string                 `url:"registrationIpAddress"`
	SecondaryGroups       []int                  `url:"secondaryGroups"`
	CustomFields          interface{}            `url:"customFields"`
	Validated             int                    `url:"validated"`
	RawProperties         map[string]interface{} `url:"rawProperties"`
}

type SystemMembersListParameters

type SystemMembersListParameters struct {
	SortBy         string `url:"sortBy,omitempty"`
	SortDir        string `url:"sortDir,omitempty"`
	Name           string `url:"name,omitempty"`
	Email          string `url:"email,omitempty"`
	Group          []int  `url:"group,omitempty"`
	ActivityAfter  int    `url:"activity_after,omitempty"`
	ActivityBefore int    `url:"activity_before,omitempty"`
	PaginationOptions
}

type SystemMembersListResponse

type SystemMembersListResponse struct {
	PaginationResponse
	Results []SystemCommonMemberObject `json:"results"`
}

type SystemMembersService

type SystemMembersService SystemService

func (*SystemMembersService) Create

func (*SystemMembersService) Delete

func (s *SystemMembersService) Delete(memberID int) (*http.Response, error)

func (*SystemMembersService) Fetch

func (*SystemMembersService) List

func (*SystemMembersService) Update

type SystemMessagesCreateParameters

type SystemMessagesCreateParameters struct {
	From  int    `url:"from"`
	To    []int  `url:"to"`
	Title string `url:"title"`
	Body  string `url:"body"`
}

type SystemMessagesService

type SystemMessagesService SystemService

func (*SystemMessagesService) Create

func (*SystemMessagesService) Delete

func (s *SystemMessagesService) Delete(msgID int) (*http.Response, error)

func (*SystemMessagesService) Update

type SystemMessagesUpdateParameters

type SystemMessagesUpdateParameters struct {
	From int    `url:"from"`
	Body string `url:"body"`
}

type SystemSearchListParameters

type SystemSearchListParameters struct {
	PaginationOptions
	Q                 string `url:"q,omitempty"`
	Tags              string `url:"tags,omitempty"`
	Type              string `url:"type,omitempty"`
	Item              int    `url:"item,omitempty"`
	Nodes             string `url:"nodes,omitempty"`
	SearchMinComments int    `url:" search_min_comments,omitempty"`
	SearchMinReplies  int    `url:"search_min_replies,omitempty"`
	SearchMinReviews  int    `url:"search_min_reviews,omitempty"`
	SearchMinViews    int    `url:"search_min_views,omitempty"`
	Author            string `url:"author,omitempty"`
	Club              string `url:"club,omitempty"`
	StartBefore       string `url:"start_before,omitempty"`
	StartAfter        string `url:"start_after,omitempty"`
	UpdatedBefore     string `url:"updated_before,omitempty"`
	UpdatedAfter      string `url:"updated_after,omitempty"`
	SortBy            string `url:"sortby,omitempty"`
	EitherTermsOrTags string `url:"eitherTermsOrTags,omitempty"`
	SearchAndOr       string `url:"search_and_or,omitempty"`
	SearchIn          string `url:"search_in,omitempty"`
	SearchAs          int    `url:"search_as,omitempty"`
}

type SystemSearchListResponse

type SystemSearchListResponse struct {
	PaginationResponse
	Results []struct {
		Title                string    `json:"title"`
		Content              string    `json:"content"`
		Class                string    `json:"class"`
		ObjectID             int       `json:"objectId"`
		ItemClass            string    `json:"itemClass"`
		ItemID               int       `json:"itemId"`
		Started              time.Time `json:"started"`
		Updated              time.Time `json:"updated"`
		ItemURL              string    `json:"itemUrl"`
		ObjectURL            string    `json:"objectUrl"`
		Reputation           int       `json:"reputation"`
		Comments             *int      `json:"comments"`
		Reviews              *int      `json:"reviews"`
		Container            string    `json:"container"`
		ContainerURL         string    `json:"containerUrl"`
		Author               string    `json:"author"`
		AuthorURL            string    `json:"authorUrl"`
		AuthorPhoto          string    `json:"authorPhoto"`
		AuthorPhotoThumbnail string    `json:"authorPhotoThumbnail"`
		Tags                 []string  `json:"tags"`
	} `json:"results"`
}

type SystemSearchService

type SystemSearchService SystemService

func (*SystemSearchService) List

func (*SystemSearchService) ListContentTypes

type SystemService

type SystemService service

func (*SystemService) AuthorizedUser

func (s *SystemService) AuthorizedUser(ctx context.Context) *SystemAuthorizedUserService

func (*SystemService) Clubs

func (*SystemService) Groups

func (*SystemService) Hello

func (*SystemService) Members

func (*SystemService) Messages

func (*SystemService) Search

func (*SystemService) WarnReasons

type SystemWarnReasonsListResponse

type SystemWarnReasonsListResponse struct {
	PaginationResponse
	Results []SystemWarnReasonsObject `json:"results"`
}

type SystemWarnReasonsObject

type SystemWarnReasonsObject struct {
	ID               int    `json:"id"`
	Name             string `json:"name"`
	DefaultNotes     string `json:"defaultNotes"`
	Points           int    `json:"points"`
	PointsOverride   bool   `json:"pointsOverride"`
	RemoveOverride   bool   `json:"removeOverride"`
	RemovePoints     string `json:"removePoints"`
	PointsAutoRemove bool   `json:"pointsAutoRemove"`
}

type SystemWarnReasonsParameters

type SystemWarnReasonsParameters struct {
	Name             string `url:"name"`
	DefaultNotes     string `url:"defaultNotes,omitempty"`
	Points           int    `url:"points,omitempty"`
	PointsOverride   bool   `url:"pointsOverride,omitempty"`
	RemoveOverride   bool   `url:"removeOverride,omitempty"`
	RemovePoints     string `url:"removePoints,omitempty"`
	PointsAutoRemove bool   `url:"pointsAutoRemove,omitempty"`
}

type SystemWarnReasonsService

type SystemWarnReasonsService SystemService

func (*SystemWarnReasonsService) Create

func (*SystemWarnReasonsService) Delete

func (s *SystemWarnReasonsService) Delete(warnID int) (*http.Response, error)

func (*SystemWarnReasonsService) Fetch

func (*SystemWarnReasonsService) List

func (*SystemWarnReasonsService) Update

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL