adapter

package
v0.0.0-...-7dcde51 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Example (One)
video := VideoOutputter{}
video.Start()

screen := Screen{}

// VDI port is incompatible with HDMI port, so the
//  following statement would cause a compile error:
//
//		screen.SetInput(video.GetOutput())
//
// To solve this problem, we need to use an adapter.
adapter := HDMI2DVIAdapter{}
adapter.SetInput(video.GetOutput())

screen.SetInput(adapter.GetOutput())
screen.Play()
Output:

0123456789

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DVIPort

type DVIPort chan string

type HDMI2DVIAdapter

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

func (*HDMI2DVIAdapter) GetOutput

func (a *HDMI2DVIAdapter) GetOutput() DVIPort

func (*HDMI2DVIAdapter) SetInput

func (a *HDMI2DVIAdapter) SetInput(in HDMIPort)

type HDMIPort

type HDMIPort chan int

type Screen

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

func (*Screen) Play

func (s *Screen) Play()

func (*Screen) SetInput

func (s *Screen) SetInput(in DVIPort)

type VideoOutputter

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

func (*VideoOutputter) GetOutput

func (o *VideoOutputter) GetOutput() HDMIPort

func (*VideoOutputter) Start

func (o *VideoOutputter) Start()

Jump to

Keyboard shortcuts

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