Skip to content

Commit e22f317

Browse files
committed
Added missing go-docs
1 parent ca30587 commit e22f317

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arduino/cores/packagemanager/registry.go

+6
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,22 @@ import (
2323
"github.com/arduino/go-paths-helper"
2424
)
2525

26+
// BoardsRegistry is a database with a list of registered boards
2627
type BoardsRegistry struct {
2728
Boards []*RegisteredBoard
2829
fqbnToBoard map[string]*RegisteredBoard
2930
aliastToBoard map[string]*RegisteredBoard
3031
}
3132

33+
// RegisteredBoard contains manifest information for a board
3234
type RegisteredBoard struct {
3335
FQBN *cores.FQBN
3436
Alias string
3537
Name string
3638
ExternalPlatformURL *url.URL
3739
}
3840

41+
// NewBoardRegistry creates a new BoardsRegistry instance
3942
func NewBoardRegistry() *BoardsRegistry {
4043
return &BoardsRegistry{
4144
Boards: []*RegisteredBoard{},
@@ -50,6 +53,7 @@ func (r *BoardsRegistry) addBoard(board *RegisteredBoard) {
5053
r.aliastToBoard[board.Alias] = board
5154
}
5255

56+
// FindBoard gets a RegisteredBoard using FQBN or Board Alias
5357
func (r *BoardsRegistry) FindBoard(fqbnOrAlias string) (*cores.FQBN, *RegisteredBoard, error) {
5458
if found, ok := r.aliastToBoard[fqbnOrAlias]; ok {
5559
return found.FQBN, found, nil
@@ -64,6 +68,7 @@ func (r *BoardsRegistry) FindBoard(fqbnOrAlias string) (*cores.FQBN, *Registered
6468
return fqbn, nil, nil
6569
}
6670

71+
// SearchBoards search for a RegisteredBoard using a query string
6772
func (r *BoardsRegistry) SearchBoards(query string) []*RegisteredBoard {
6873
found := []*RegisteredBoard{}
6974
contains := func(a string, b string) bool {
@@ -77,6 +82,7 @@ func (r *BoardsRegistry) SearchBoards(query string) []*RegisteredBoard {
7782
return found
7883
}
7984

85+
// LoadBoardRegistry retrieve a board registry from a file. WIP...
8086
func LoadBoardRegistry(file *paths.Path) (*BoardsRegistry, error) {
8187

8288
// TODO...

0 commit comments

Comments
 (0)