disadvantages

package
v0.0.0-...-de70ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Example
package main

func main() {

}

// StubClient is a stub implementation of disadvantages.Client interface
type StubClient struct{}

// DoSomethingUseful implements disadvantages.Client
func (s *StubClient) DoSomethingUseful() (bool, error) {
	return true, nil
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DealCards

func DealCards() (player1 []Card, player2 []Card)

Dealer will shuffle a deck of cards and deal them to the players

Types

type Card

type Card struct {
	Suit  string
	Value string
}

Card is single Playing Card

type Client

type Client interface {
	DoSomethingUseful() (bool, error)
}

Client is the exported API

func NewClient

func NewClient(service DepService) Client

NewClient creates and initialises the client

type DepService

type DepService interface {
	DoSomethingElse()
}

type Dependency

type Dependency interface {
}

fake type to satisfy the compiler

type FetchRates

type FetchRates struct{}

FetchRates rates from downstream service

func (*FetchRates) Fetch

func (f *FetchRates) Fetch() ([]Rate, error)

type InnerService

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

func NewInnerService

func NewInnerService(innerDep Dependency) *InnerService

type OuterService

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

func NewOuterService

func NewOuterService(outerDep Dependency, innerDep Dependency) *OuterService

type Rate

type Rate struct {
	Code  string
	Value float64
}

type Shuffler

type Shuffler interface {
	Shuffle(cards []Card)
}

Shuffler will shuffle (randomize) the supplied cards

Jump to

Keyboard shortcuts

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