class EventService extends AnyRef
GitHub events service.
- Alphabetic
- By Inheritance
- EventService
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
EventService(duplicateFilter: Boolean, keyManager: KeyManager, duplicateCheckSize: Int = 1000000)
- duplicateFilter
if there should be checked for duplicates.
- keyManager
the keymanager to use for the requests.
Value Members
- val EVENTS_SIZE: Int
-
def
doPagedRequest(endPoint: String): GitHubResponse
Do a request for a certain page.
Do a request for a certain page.
- endPoint
the page endpoint
- returns
a github response.
- val dupCheck: DuplicateService[String]
-
def
getLatestEvents(): List[Event]
Requests the latest events.
Requests the latest events. Most often there are 3 pages with events, so 3 requests.
- returns
a list of events.
-
def
parseEvents(body: String): List[Event]
Parse all JSON events into an Event case class.
Parse all JSON events into an Event case class.
- body
the body to parse.
- returns
the list of events.
-
def
parseNextAndLastPage(linkHeader: Header): (Int, Int)
Parses the next and last page based on the link header.
Parses the next and last page based on the link header.
- linkHeader
the lnkheader to parse from.
- returns
a tuple containing the next and last page id.
-
def
parsePages(url: String): List[Page]
Parses the link header into 'pages'.
Parses the link header into 'pages'.
- url
the full header value.
- returns
a list of pages.
- var requestHeaders: List[Header]
-
def
setKey(apiKey: String): Unit
Set the API key of the event-service.
Set the API key of the event-service.
- apiKey
the API key to use.
-
def
updateOrAddHeader(key: String, value: Array[String]): Unit
Updates or adds a request header.
Updates or adds a request header.
- key
the header key.
- value
the header value.
-
def
updateOrAddHeader(header: Header): Unit
Updates or adds a header.
Updates or adds a header.
- header
the header to add or update.
-
def
updateRequestHeaders(reponseHeaders: List[Header]): Unit
Update all the request headers based on the response headers.
Update all the request headers based on the response headers.
- reponseHeaders
the response headers.