server_auth

package
v0.0.0-...-93088af Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2013 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HttpResponseError     = errors.New("HTTP response error")
	ResponseTooLargeError = errors.New("HTTP response too large")
)

Functions

This section is empty.

Types

type DummyAuth

type DummyAuth struct {
	Result bool
}

DummyAuth is a no-op authentication server, always returning the value of 'Result'.

func (*DummyAuth) Authenticate

func (d *DummyAuth) Authenticate(sessionId, username string) (authenticated bool, err error)

Authenticate implements the IAuthenticator.Authenticate method

type IAuthenticator

type IAuthenticator interface {
	Authenticate(sessionId, username string) (ok bool, err error)
}

An IAuthenticator takes a sessionId and a username string and attempts to authenticate against a server. This interface allows for the use of a dummy authentication server for testing purposes.

type ServerAuth

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

ServerAuth represents authentication against a server, particularly the main minecraft server at http://www.minecraft.net/game/checkserver.jsp.

func NewServerAuth

func NewServerAuth(baseUrlStr string) (s *ServerAuth, err error)

func (*ServerAuth) Authenticate

func (s *ServerAuth) Authenticate(sessionId, username string) (authenticated bool, err error)

Authenticate implements the IAuthenticator.Authenticate method

Jump to

Keyboard shortcuts

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