Skip to content
Snippets Groups Projects
Commit 869f07b2 authored by Kevin Lyda's avatar Kevin Lyda :speech_balloon:
Browse files

Small initial pass at a geiger interface.

parent 3ee012cf
No related branches found
No related tags found
No related merge requests found
Pipeline #
//
// geiger.go
// Copyright (C) 2017 kevin <kevin@ie.suberic.net>
//
// Distributed under terms of the GPL license.
//
package geiger
// New creates a new Counter instance
func New(c Config) (Counter, error) {
switch c.Model {
case "gqgmc":
return NewGQGMC(c)
}
return nil, nil
}
// Counter is an interface for Geiger Counters
type Counter interface {
GetReading() (*Reading, error)
}
// Config contain the configuration for a Geiger Counter
type Config struct {
Model string
Device string
Options map[string]string
}
// Reading contains a single geiger reading
type Reading struct {
CPM float64
}
//
// gqgmc.go
// Copyright (C) 2017 kevin <kevin@phrye.com>
//
// Distributed under terms of the GPL license.
//
package geiger
// GQGMCCounter is a GQ GMC Counter
type GQGMCCounter struct {
fh string // TODO: make this a file handle.
}
// NewGQGMC creates a new GQGMC Counter instance
func NewGQGMC(c Config) (*GQGMCCounter, error) {
return &GQGMCCounter{
fh: "TODO",
}, nil
}
// GetReading returns a reading.
func (gc *GQGMCCounter) GetReading() (*Reading, error) {
return nil, nil
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment