server

package
v0.0.0-...-94f56ab Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2018 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const WheelRateLimit = 5
View Source
const WheelRateLimitDuration = time.Minute * 5
View Source
const WheelRequests = 3
View Source
const WheelSelectionPool = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	CorsDisabled bool
	// contains filtered or unexported fields
}

func New

func New(mux *http.ServeMux, search *search.Client, cacheClient *cache.Cache, twitchClient *twitch.Client) *Server

func (*Server) HandleCommunitySearch

func (s *Server) HandleCommunitySearch(w http.ResponseWriter, req *http.Request)

func (*Server) HandleGameSearch

func (s *Server) HandleGameSearch(w http.ResponseWriter, req *http.Request)

func (*Server) HandleGetCommunity

func (s *Server) HandleGetCommunity(w http.ResponseWriter, req *http.Request)

func (*Server) HandleGetGame

func (s *Server) HandleGetGame(w http.ResponseWriter, req *http.Request)

func (*Server) HandleStatistics

func (s *Server) HandleStatistics(w http.ResponseWriter, req *http.Request)

func (*Server) HandleWheel

func (s *Server) HandleWheel(w http.ResponseWriter, req *http.Request)

type WheelSelection

type WheelSelection struct {
	Stream *twitch.Stream `json:"stream"`
	Game   *twitch.Game   `json:"game"`
	User   *twitch.User   `json:"user"`
}

Jump to

Keyboard shortcuts

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