app

package
v0.0.0-...-06cdc59 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeHmac256

func ComputeHmac256(message []byte, secret string) string

Generates the Signature for the Header

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func NewClient(optional... Optional) (*Client, error)

func NewClientWithTestUrl

func NewClientWithTestUrl(testUrl string) *Client

func (*Client) DepartureList

func (*Client) GetRoute

func (c *Client) GetRoute(r *config.HVVRequest) (*GetRouteResponse, error)

type GetRouteResponse

type GetRouteResponse struct {
	RealtimeSchedules []struct {
		Start            config.Station `json:"start"`
		Dest             config.Station `json:"dest"`
		Time             float64        `json:"time"`
		FootpathTime     float64        `json:"footpathTime"`
		ScheduleElements []struct {
			From struct {
				Name    string          `json:"name"`
				DepTime config.DateTime `json:"depTime"`
			} `json:"from,omitempty"`
			To struct {
				Name    string          `json:"name"`
				ArrTime config.DateTime `json:"arrTime"`
			} `json:"to,omitempty"`
			Line struct {
				BusLine   string `json:"name"`
				Direction string `json:"direction"`
				Origin    string `json:"origin"`
				Type      struct {
					SimpleType string `json:"simpleType"`
					ShortInfo  string `json:"shortInfo"`
				} `json:"type"`
			} `json:"line,omitempty"`
		} `json:"scheduleElements"`
	} `json:"realtimeSchedules"`
}

Expected Response from HBT API

type HVVCommonResponse

type HVVCommonResponse struct {
	Status       config.Status       `json:"returnCode"`
	ErrorMessage config.ErrorMessage `json:"errorDevInfo,omitempty"`
	ErrorText    string              `json:"errorText,omitempty"`
}

func (*HVVCommonResponse) StatusError

func (c *HVVCommonResponse) StatusError() error

StatusError returns an error if this object has a Status different

type HVVDepartureListResponse

type HVVDepartureListResponse struct {
	Time struct {
		Date string `json:"date"`
		Time string `json:"time"`
	} `json:"time"`
	Departures []struct {
		Line struct {
			Name      string `json:"name"`
			Direction string `json:"direction"`
			Origin    string `json:"origin"`
			Type      struct {
				SimpleType string `json:"simpleType"`
				ShortInfo  string `json:"shortInfo"`
			} `json:"type"`
		} `json:"line"`
		TimeOffset int `json:"timeOffset"`
	} `json:"departures"`
}

Expected Response for DepatureList from HBT API

Jump to

Keyboard shortcuts

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