gopkg.in/hugelgupf/u-root.v2@v2.0.0-20180831055005-3f8fdb0ce09d/pkg/wifi/stub.go (about)

     1  // Copyright 2018 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package wifi
     6  
     7  var _ = WiFi(&StubWorker{})
     8  
     9  type StubWorker struct {
    10  	Options []Option
    11  	ID      string
    12  }
    13  
    14  func (w *StubWorker) Scan() ([]Option, error) {
    15  	return w.Options, nil
    16  }
    17  
    18  func (w *StubWorker) GetID() (string, error) {
    19  	return w.ID, nil
    20  }
    21  
    22  func (*StubWorker) Connect(a ...string) error {
    23  	return nil
    24  }
    25  
    26  func NewStubWorker(id string, options ...Option) (WiFi, error) {
    27  	return &StubWorker{ID: id, Options: options}, nil
    28  }