osvisitors

package module
v0.0.0-...-cac9657 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2016 License: MIT Imports: 3 Imported by: 7

README

osvisitors

Visitor pattern for different OS types - windows, linux, etc

Example

See the example.go file for a simple example of using this visitor to print the PATH variable of the specific OS.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoOSNameVisitor

type GoOSNameVisitor struct{ Name string }

func (*GoOSNameVisitor) VisitDarwin

func (g *GoOSNameVisitor) VisitDarwin()

func (*GoOSNameVisitor) VisitLinux

func (g *GoOSNameVisitor) VisitLinux()

func (*GoOSNameVisitor) VisitWindows

func (g *GoOSNameVisitor) VisitWindows()

type OsType

type OsType interface {
	Accept(v OsTypeVisitor)
}
var (
	WindowsOs OsType = &windows{}
	LinuxOs   OsType = &linux{}
	DarwinOs  OsType = &darwin{}

	AllList []OsType = []OsType{
		WindowsOs,
		LinuxOs,
		DarwinOs,
	}
)

func GetRuntimeOsType

func GetRuntimeOsType() (OsType, error)

func ParseFromName

func ParseFromName(name string) (OsType, error)

type OsTypeVisitor

type OsTypeVisitor interface {
	VisitWindows()
	VisitLinux()
	VisitDarwin()
}

Jump to

Keyboard shortcuts

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