Documentation ¶
Overview ¶
The package connpass provides API client of connpass. You can see details of connpass API via https://connpass.com/about/api/.
Index ¶
- Constants
- func SearchParam(params ...Param) (url.Values, error)
- type APIError
- type Client
- type Event
- type OrderBy
- type Param
- func Count(count int) Param
- func EventID(eventID int) Param
- func Keyword(keyword string) Param
- func KeywordOr(keyword string) Param
- func Nickname(nickname string) Param
- func Order(by OrderBy) Param
- func OwnerNickname(nickname string) Param
- func SeriesID(seriesID int) Param
- func Start(start int) Param
- func YearMonth(year int, month time.Month) Param
- func YearMonthDay(year int, month time.Month, day int) Param
- type SearchResult
- type SearchService
- type Series
- type Type
Constants ¶
const ( TypeParticipation = "participation" TypeAdvertisement = "advertisement" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
StatusCode int
}
APIError represents an error of connpass API.
type Client ¶
type Client struct { SearchService HTTPClient *http.Client BaseURL string UserAgent string }
Client is a client of connpass API.
type Event ¶
type Event struct { ID int `json:"event_id"` Title string `json:"title"` Catch string `json:"catch"` Description string `json:"description"` URL string `json:"event_url"` Hashtag string `json:"hash_tag"` StartedAt time.Time `json:"started_at"` EndedAt time.Time `json:"ended_at"` Limit int `json:"limit"` Type Type `json:"event_type"` Series Series `json:"series"` Address string `json:"address"` Place string `json:"place"` Lat string `json:"lat"` Lon string `json:"lon"` OwnerID int `json:"owner_id"` OwnerNickname string `json:"owner_nickname"` OwnerDisplayName string `json:"owner_display_name"` Accepted int `json:"accepted"` Waiting int `json:"waiting"` UpdatedAt time.Time `json:"updated_at"` }
Event repressents a single event of connpass.
type Param ¶
Param is a function which set a value to url.Values.
func EventID ¶
EventID sets value to url.Values with key "event_id". eventID must be positive integer.
func Keyword ¶
Keyword sets value to url.Values with key "keyword". keyword must not be empty string.
func KeywordOr ¶
KeywordOr sets value to url.Values with key "keyword_or". keyword must not be empty string.
func Nickname ¶
Nickname sets value to url.Values with key "nickname". nickname must not be empty string.
func Order ¶
Order sets value to url.Values with key "order". order must be OrderByUpdate, OrderByDate or OrderByNewest.
func OwnerNickname ¶
OwnerNickname sets value to url.Values with key "owner_nickname". nickname must not be empty string.
func SeriesID ¶
SeriesID sets value to url.Values with key "series_id". seriesID must be positive integer.
type SearchResult ¶
type SearchResult struct { Returned int `json:"results_returned"` Available int `json:"results_available"` Start int `json:"results_start"` Events []*Event `json:"events"` }
SearchResult represents a result of Search.
type SearchService ¶
type SearchService interface {
Search(ctx context.Context, params url.Values) (*SearchResult, error)
}
SearchService provides the Search method which searches events of connpass.