common

package
v0.0.0-...-7052b7e Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateExplorationArray

func CreateExplorationArray(rows int, cols int) [][]int

CreateExplorationArray : creates an array with zeros of given rows and columns

func FetchMyPublicIP

func FetchMyPublicIP(host ...string) string

FetchMyPublicIP : This function will fetch public ip from ifconfig.co

func GetHomeDirectory

func GetHomeDirectory() string

GetHomeDirectory : gets current user home directy

func HandleError

func HandleError(err error)

HandleError : This function will log the error

func NodeLength

func NodeLength(node *Node) int

NodeLength : counts the length

func PrintArray

func PrintArray(array [][]int)

PrintArray : Prints array

func PrintNodes

func PrintNodes(n Node)

PrintNodes : Prints the nodes

func ReadArray

func ReadArray() ([][]int, int, int)

ReadArray : creates two diamentional array as per user input

func ReadRemoteIP

func ReadRemoteIP(r *http.Request) string

ReadRemoteIP : Reads the remote ip address from where the request came.

func RedirectToHTTPS

func RedirectToHTTPS(httpPort int, host string)

RedirectToHTTPS : This will redirect request comming to port 80 to 443

func SetStaticContentPath

func SetStaticContentPath(mapping string, path string)

SetStaticContentPath : Set the path from where the static content will be served

Types

type Node

type Node struct {
	X        int
	Y        int
	Previous *Node
}

Node : node with x, y co-ordinate

func CloneNode

func CloneNode(n *Node) Node

CloneNode : clones the Node

Jump to

Keyboard shortcuts

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