Module match_stream

Match Stream main interface.

Copyright (C) 2011 InakaLabs SRL

Behaviours: application.

Authors: Fernando Benavides (fernando.benavides@inakanetworks.com).

Description

Match Stream main interface

Data Types

data()

data() = {home, team()} | {home_players, [player()]} | {home_score, non_neg_integer()} | {visit, team()} | {visit_players, [player()]} | {visit_score, non_neg_integer()} | {period, period()} | {start_time, datetime()} | {team, team()} | {player_team, team()} | {player, player()} | {player_out, player()} | {player_in, player()} | {card, red | yellow} | {comment, binary()}

date()

date() = {2000..3000, 1..12, 1..31}

datetime()

datetime() = {date(), time()}

event()

event() = #match_stream_event{}

event_kind()

event_kind() = status | start | stop | halftime_start | halftime_stop | extratime | shot | save | goal | corner | goalkick | offside | foul | penalty | freekick | card | substitution | throwin

match()

match() = #match_stream_match{}

match_id()

match_id() = binary()

period()

period() = not_started | first | last | halftime | first_extra | halftime_extra | last_extra | ended

player()

player() = {pos_integer(), binary()}

Number and name

team()

team() = binary()

time()

time() = {0..23, 0..59, 0..59}

user()

user() = #match_stream_user{}

user_id()

user_id() = binary()

Function Index

cancel_match/1Cancels a match.
cancel_match/3Cancels a match.
history/1List of match events.
history/3List of match events.
match/1List of available matches.
matches/0List of available matches.
new_match/3Registers a match.
register_event/3Something happened in a match.
register_event/5Something happened in a match.
start/0Starts the application.
stop/0Stops the application.
timestamp/0now in milliseconds.

Function Details

cancel_match/1

cancel_match(MatchId::match_id()) -> ok

Cancels a match

cancel_match/3

cancel_match(Home::team(), Visit::team(), StartDate::date()) -> ok

Cancels a match

history/1

history(MatchId::match_id()) -> [event()]

List of match events

history/3

history(Home::team(), Visit::team(), StartDate::date()) -> [event()]

List of match events

match/1

match(MatchId::match_id()) -> not_found | match_stream:match()

List of available matches

matches/0

matches() -> [match_id()]

List of available matches

new_match/3

new_match(Home::team(), Visit::team(), StartDate::date()) -> {ok, match_id()} | {error, {duplicated, match_id()}}

Registers a match

register_event/3

register_event(MatchId::match_id(), Kind::event_kind(), Data::[{atom(), binary()}]) -> ok

Something happened in a match

register_event/5

register_event(Home::team(), Visit::team(), StartDate::date(), Kind::event_kind(), Data::[{atom(), binary()}]) -> ok

Something happened in a match

start/0

start() -> ok | {error, {already_started, match_stream}}

Starts the application

stop/0

stop() -> ok

Stops the application

timestamp/0

timestamp() -> pos_integer()

now in milliseconds


Generated by EDoc, Sep 21 2011, 16:21:48.