Packages

class EventService extends AnyRef

GitHub events service.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EventService
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. 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

  1. val EVENTS_SIZE: Int
  2. 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.

  3. val dupCheck: DuplicateService[String]
  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. var requestHeaders: List[Header]
  9. 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.

  10. 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.

  11. def updateOrAddHeader(header: Header): Unit

    Updates or adds a header.

    Updates or adds a header.

    header

    the header to add or update.

  12. 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.