id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
163,900
rivo/tview
table.go
InsertRow
func (t *Table) InsertRow(row int) *Table { if row >= len(t.cells) { return t } t.cells = append(t.cells, nil) // Extend by one. copy(t.cells[row+1:], t.cells[row:]) // Shift down. t.cells[row] = nil // New row is uninitialized. return t }
go
func (t *Table) InsertRow(row int) *Table { if row >= len(t.cells) { return t } t.cells = append(t.cells, nil) // Extend by one. copy(t.cells[row+1:], t.cells[row:]) // Shift down. t.cells[row] = nil // New row is uninitialized. return t }
[ "func", "(", "t", "*", "Table", ")", "InsertRow", "(", "row", "int", ")", "*", "Table", "{", "if", "row", ">=", "len", "(", "t", ".", "cells", ")", "{", "return", "t", "\n", "}", "\n", "t", ".", "cells", "=", "append", "(", "t", ".", "cells",...
// InsertRow inserts a row before the row with the given index. Cells on the // given row and below will be shifted to the bottom by one row. If "row" is // equal or larger than the current number of rows, this function has no effect.
[ "InsertRow", "inserts", "a", "row", "before", "the", "row", "with", "the", "given", "index", ".", "Cells", "on", "the", "given", "row", "and", "below", "will", "be", "shifted", "to", "the", "bottom", "by", "one", "row", ".", "If", "row", "is", "equal",...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/table.go#L481-L489
163,901
rivo/tview
table.go
InsertColumn
func (t *Table) InsertColumn(column int) *Table { for row := range t.cells { if column >= len(t.cells[row]) { continue } t.cells[row] = append(t.cells[row], nil) // Extend by one. copy(t.cells[row][column+1:], t.cells[row][column:]) // Shift to the right. t.cells[row][column] = &TableCell{} ...
go
func (t *Table) InsertColumn(column int) *Table { for row := range t.cells { if column >= len(t.cells[row]) { continue } t.cells[row] = append(t.cells[row], nil) // Extend by one. copy(t.cells[row][column+1:], t.cells[row][column:]) // Shift to the right. t.cells[row][column] = &TableCell{} ...
[ "func", "(", "t", "*", "Table", ")", "InsertColumn", "(", "column", "int", ")", "*", "Table", "{", "for", "row", ":=", "range", "t", ".", "cells", "{", "if", "column", ">=", "len", "(", "t", ".", "cells", "[", "row", "]", ")", "{", "continue", ...
// InsertColumn inserts a column before the column with the given index. Cells // in the given column and to its right will be shifted to the right by one // column. Rows that have fewer initialized cells than "column" will remain // unchanged.
[ "InsertColumn", "inserts", "a", "column", "before", "the", "column", "with", "the", "given", "index", ".", "Cells", "in", "the", "given", "column", "and", "to", "its", "right", "will", "be", "shifted", "to", "the", "right", "by", "one", "column", ".", "R...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/table.go#L495-L505
163,902
rivo/tview
table.go
ScrollToBeginning
func (t *Table) ScrollToBeginning() *Table { t.trackEnd = false t.columnOffset = 0 t.rowOffset = 0 return t }
go
func (t *Table) ScrollToBeginning() *Table { t.trackEnd = false t.columnOffset = 0 t.rowOffset = 0 return t }
[ "func", "(", "t", "*", "Table", ")", "ScrollToBeginning", "(", ")", "*", "Table", "{", "t", ".", "trackEnd", "=", "false", "\n", "t", ".", "columnOffset", "=", "0", "\n", "t", ".", "rowOffset", "=", "0", "\n", "return", "t", "\n", "}" ]
// ScrollToBeginning scrolls the table to the beginning to that the top left // corner of the table is shown. Note that this position may be corrected if // there is a selection.
[ "ScrollToBeginning", "scrolls", "the", "table", "to", "the", "beginning", "to", "that", "the", "top", "left", "corner", "of", "the", "table", "is", "shown", ".", "Note", "that", "this", "position", "may", "be", "corrected", "if", "there", "is", "a", "selec...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/table.go#L523-L528
163,903
rivo/tview
table.go
ScrollToEnd
func (t *Table) ScrollToEnd() *Table { t.trackEnd = true t.columnOffset = 0 t.rowOffset = len(t.cells) return t }
go
func (t *Table) ScrollToEnd() *Table { t.trackEnd = true t.columnOffset = 0 t.rowOffset = len(t.cells) return t }
[ "func", "(", "t", "*", "Table", ")", "ScrollToEnd", "(", ")", "*", "Table", "{", "t", ".", "trackEnd", "=", "true", "\n", "t", ".", "columnOffset", "=", "0", "\n", "t", ".", "rowOffset", "=", "len", "(", "t", ".", "cells", ")", "\n", "return", ...
// ScrollToEnd scrolls the table to the beginning to that the bottom left corner // of the table is shown. Adding more rows to the table will cause it to // automatically scroll with the new data. Note that this position may be // corrected if there is a selection.
[ "ScrollToEnd", "scrolls", "the", "table", "to", "the", "beginning", "to", "that", "the", "bottom", "left", "corner", "of", "the", "table", "is", "shown", ".", "Adding", "more", "rows", "to", "the", "table", "will", "cause", "it", "to", "automatically", "sc...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/table.go#L534-L539
163,904
rivo/tview
demos/presentation/introduction.go
Introduction
func Introduction(nextSlide func()) (title string, content tview.Primitive) { list := tview.NewList(). AddItem("A Go package for terminal based UIs", "with a special focus on rich interactive widgets", '1', nextSlide). AddItem("Based on github.com/gdamore/tcell", "Like termbox but better (see tcell docs)", '2', ne...
go
func Introduction(nextSlide func()) (title string, content tview.Primitive) { list := tview.NewList(). AddItem("A Go package for terminal based UIs", "with a special focus on rich interactive widgets", '1', nextSlide). AddItem("Based on github.com/gdamore/tcell", "Like termbox but better (see tcell docs)", '2', ne...
[ "func", "Introduction", "(", "nextSlide", "func", "(", ")", ")", "(", "title", "string", ",", "content", "tview", ".", "Primitive", ")", "{", "list", ":=", "tview", ".", "NewList", "(", ")", ".", "AddItem", "(", "\"", "\"", ",", "\"", "\"", ",", "'...
// Introduction returns a tview.List with the highlights of the tview package.
[ "Introduction", "returns", "a", "tview", ".", "List", "with", "the", "highlights", "of", "the", "tview", "package", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/demos/presentation/introduction.go#L6-L14
163,905
rivo/tview
demos/presentation/flex.go
Flex
func Flex(nextSlide func()) (title string, content tview.Primitive) { modalShown := false pages := tview.NewPages() textView := tview.NewTextView(). SetDoneFunc(func(key tcell.Key) { if modalShown { nextSlide() modalShown = false } else { pages.ShowPage("modal") modalShown = true } }) t...
go
func Flex(nextSlide func()) (title string, content tview.Primitive) { modalShown := false pages := tview.NewPages() textView := tview.NewTextView(). SetDoneFunc(func(key tcell.Key) { if modalShown { nextSlide() modalShown = false } else { pages.ShowPage("modal") modalShown = true } }) t...
[ "func", "Flex", "(", "nextSlide", "func", "(", ")", ")", "(", "title", "string", ",", "content", "tview", ".", "Primitive", ")", "{", "modalShown", ":=", "false", "\n", "pages", ":=", "tview", ".", "NewPages", "(", ")", "\n", "textView", ":=", "tview",...
// Flex demonstrates flexbox layout.
[ "Flex", "demonstrates", "flexbox", "layout", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/demos/presentation/flex.go#L9-L39
163,906
rivo/tview
demos/presentation/helloworld.go
HelloWorld
func HelloWorld(nextSlide func()) (title string, content tview.Primitive) { // We use a text view because we want to capture keyboard input. textView := tview.NewTextView().SetDoneFunc(func(key tcell.Key) { nextSlide() }) textView.SetBorder(true).SetTitle("Hello, world!") return "Hello, world", Code(textView, 30...
go
func HelloWorld(nextSlide func()) (title string, content tview.Primitive) { // We use a text view because we want to capture keyboard input. textView := tview.NewTextView().SetDoneFunc(func(key tcell.Key) { nextSlide() }) textView.SetBorder(true).SetTitle("Hello, world!") return "Hello, world", Code(textView, 30...
[ "func", "HelloWorld", "(", "nextSlide", "func", "(", ")", ")", "(", "title", "string", ",", "content", "tview", ".", "Primitive", ")", "{", "// We use a text view because we want to capture keyboard input.", "textView", ":=", "tview", ".", "NewTextView", "(", ")", ...
// HelloWorld shows a simple "Hello world" example.
[ "HelloWorld", "shows", "a", "simple", "Hello", "world", "example", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/demos/presentation/helloworld.go#L24-L31
163,907
rivo/tview
demos/presentation/main.go
main
func main() { // The presentation slides. slides := []Slide{ Cover, Introduction, HelloWorld, InputField, Form, TextView1, TextView2, Table, TreeView, Flex, Grid, Colors, End, } // The bottom row has some info on where we are. info := tview.NewTextView(). SetDynamicColors(true). SetR...
go
func main() { // The presentation slides. slides := []Slide{ Cover, Introduction, HelloWorld, InputField, Form, TextView1, TextView2, Table, TreeView, Flex, Grid, Colors, End, } // The bottom row has some info on where we are. info := tview.NewTextView(). SetDynamicColors(true). SetR...
[ "func", "main", "(", ")", "{", "// The presentation slides.", "slides", ":=", "[", "]", "Slide", "{", "Cover", ",", "Introduction", ",", "HelloWorld", ",", "InputField", ",", "Form", ",", "TextView1", ",", "TextView2", ",", "Table", ",", "TreeView", ",", "...
// Starting point for the presentation.
[ "Starting", "point", "for", "the", "presentation", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/demos/presentation/main.go#L32-L98
163,908
rivo/tview
demos/presentation/inputfield.go
InputField
func InputField(nextSlide func()) (title string, content tview.Primitive) { input := tview.NewInputField(). SetLabel("Enter a number: "). SetAcceptanceFunc(tview.InputFieldInteger).SetDoneFunc(func(key tcell.Key) { nextSlide() }) return "Input", Code(input, 30, 1, inputField) }
go
func InputField(nextSlide func()) (title string, content tview.Primitive) { input := tview.NewInputField(). SetLabel("Enter a number: "). SetAcceptanceFunc(tview.InputFieldInteger).SetDoneFunc(func(key tcell.Key) { nextSlide() }) return "Input", Code(input, 30, 1, inputField) }
[ "func", "InputField", "(", "nextSlide", "func", "(", ")", ")", "(", "title", "string", ",", "content", "tview", ".", "Primitive", ")", "{", "input", ":=", "tview", ".", "NewInputField", "(", ")", ".", "SetLabel", "(", "\"", "\"", ")", ".", "SetAcceptan...
// InputField demonstrates the InputField.
[ "InputField", "demonstrates", "the", "InputField", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/demos/presentation/inputfield.go#L33-L40
163,909
rivo/tview
grid.go
SetMinSize
func (g *Grid) SetMinSize(row, column int) *Grid { if row < 0 || column < 0 { panic("Invalid minimum row/column size") } g.minHeight, g.minWidth = row, column return g }
go
func (g *Grid) SetMinSize(row, column int) *Grid { if row < 0 || column < 0 { panic("Invalid minimum row/column size") } g.minHeight, g.minWidth = row, column return g }
[ "func", "(", "g", "*", "Grid", ")", "SetMinSize", "(", "row", ",", "column", "int", ")", "*", "Grid", "{", "if", "row", "<", "0", "||", "column", "<", "0", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "g", ".", "minHeight", ",", "g", ...
// SetMinSize sets an absolute minimum width for rows and an absolute minimum // height for columns. Panics if negative values are provided.
[ "SetMinSize", "sets", "an", "absolute", "minimum", "width", "for", "rows", "and", "an", "absolute", "minimum", "height", "for", "columns", ".", "Panics", "if", "negative", "values", "are", "provided", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/grid.go#L139-L145
163,910
rivo/tview
grid.go
SetBordersColor
func (g *Grid) SetBordersColor(color tcell.Color) *Grid { g.bordersColor = color return g }
go
func (g *Grid) SetBordersColor(color tcell.Color) *Grid { g.bordersColor = color return g }
[ "func", "(", "g", "*", "Grid", ")", "SetBordersColor", "(", "color", "tcell", ".", "Color", ")", "*", "Grid", "{", "g", ".", "bordersColor", "=", "color", "\n", "return", "g", "\n", "}" ]
// SetBordersColor sets the color of the item borders.
[ "SetBordersColor", "sets", "the", "color", "of", "the", "item", "borders", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/grid.go#L167-L170
163,911
rivo/tview
grid.go
RemoveItem
func (g *Grid) RemoveItem(p Primitive) *Grid { for index := len(g.items) - 1; index >= 0; index-- { if g.items[index].Item == p { g.items = append(g.items[:index], g.items[index+1:]...) } } return g }
go
func (g *Grid) RemoveItem(p Primitive) *Grid { for index := len(g.items) - 1; index >= 0; index-- { if g.items[index].Item == p { g.items = append(g.items[:index], g.items[index+1:]...) } } return g }
[ "func", "(", "g", "*", "Grid", ")", "RemoveItem", "(", "p", "Primitive", ")", "*", "Grid", "{", "for", "index", ":=", "len", "(", "g", ".", "items", ")", "-", "1", ";", "index", ">=", "0", ";", "index", "--", "{", "if", "g", ".", "items", "["...
// RemoveItem removes all items for the given primitive from the grid, keeping // the order of the remaining items intact.
[ "RemoveItem", "removes", "all", "items", "for", "the", "given", "primitive", "from", "the", "grid", "keeping", "the", "order", "of", "the", "remaining", "items", "intact", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/grid.go#L214-L221
163,912
rivo/tview
grid.go
SetOffset
func (g *Grid) SetOffset(rows, columns int) *Grid { g.rowOffset, g.columnOffset = rows, columns return g }
go
func (g *Grid) SetOffset(rows, columns int) *Grid { g.rowOffset, g.columnOffset = rows, columns return g }
[ "func", "(", "g", "*", "Grid", ")", "SetOffset", "(", "rows", ",", "columns", "int", ")", "*", "Grid", "{", "g", ".", "rowOffset", ",", "g", ".", "columnOffset", "=", "rows", ",", "columns", "\n", "return", "g", "\n", "}" ]
// SetOffset sets the number of rows and columns which are skipped before // drawing the first grid cell in the top-left corner. As the grid will never // completely move off the screen, these values may be adjusted the next time // the grid is drawn. The actual position of the grid may also be adjusted such // that co...
[ "SetOffset", "sets", "the", "number", "of", "rows", "and", "columns", "which", "are", "skipped", "before", "drawing", "the", "first", "grid", "cell", "in", "the", "top", "-", "left", "corner", ".", "As", "the", "grid", "will", "never", "completely", "move"...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/grid.go#L234-L237
163,913
rivo/tview
demos/presentation/colors.go
Colors
func Colors(nextSlide func()) (title string, content tview.Primitive) { table := tview.NewTable(). SetBorders(true). SetBordersColor(tcell.ColorBlue). SetDoneFunc(func(key tcell.Key) { nextSlide() }) var row, column int for _, word := range strings.Split(colorsText, " ") { table.SetCellSimple(row, colum...
go
func Colors(nextSlide func()) (title string, content tview.Primitive) { table := tview.NewTable(). SetBorders(true). SetBordersColor(tcell.ColorBlue). SetDoneFunc(func(key tcell.Key) { nextSlide() }) var row, column int for _, word := range strings.Split(colorsText, " ") { table.SetCellSimple(row, colum...
[ "func", "Colors", "(", "nextSlide", "func", "(", ")", ")", "(", "title", "string", ",", "content", "tview", ".", "Primitive", ")", "{", "table", ":=", "tview", ".", "NewTable", "(", ")", ".", "SetBorders", "(", "true", ")", ".", "SetBordersColor", "(",...
// Colors demonstrates how to use colors.
[ "Colors", "demonstrates", "how", "to", "use", "colors", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/demos/presentation/colors.go#L13-L33
163,914
rivo/tview
demos/presentation/cover.go
Cover
func Cover(nextSlide func()) (title string, content tview.Primitive) { // What's the size of the logo? lines := strings.Split(logo, "\n") logoWidth := 0 logoHeight := len(lines) for _, line := range lines { if len(line) > logoWidth { logoWidth = len(line) } } logoBox := tview.NewTextView(). SetTextColor...
go
func Cover(nextSlide func()) (title string, content tview.Primitive) { // What's the size of the logo? lines := strings.Split(logo, "\n") logoWidth := 0 logoHeight := len(lines) for _, line := range lines { if len(line) > logoWidth { logoWidth = len(line) } } logoBox := tview.NewTextView(). SetTextColor...
[ "func", "Cover", "(", "nextSlide", "func", "(", ")", ")", "(", "title", "string", ",", "content", "tview", ".", "Primitive", ")", "{", "// What's the size of the logo?", "lines", ":=", "strings", ".", "Split", "(", "logo", ",", "\"", "\\n", "\"", ")", "\...
// Cover returns the cover page.
[ "Cover", "returns", "the", "cover", "page", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/demos/presentation/cover.go#L26-L61
163,915
rivo/tview
form.go
NewForm
func NewForm() *Form { box := NewBox().SetBorderPadding(1, 1, 1, 1) f := &Form{ Box: box, itemPadding: 1, labelColor: Styles.SecondaryTextColor, fieldBackgroundColor: Styles.ContrastBackgroundColor, fieldTextColor: Styles.PrimaryTextColor, buttonBackgroundCo...
go
func NewForm() *Form { box := NewBox().SetBorderPadding(1, 1, 1, 1) f := &Form{ Box: box, itemPadding: 1, labelColor: Styles.SecondaryTextColor, fieldBackgroundColor: Styles.ContrastBackgroundColor, fieldTextColor: Styles.PrimaryTextColor, buttonBackgroundCo...
[ "func", "NewForm", "(", ")", "*", "Form", "{", "box", ":=", "NewBox", "(", ")", ".", "SetBorderPadding", "(", "1", ",", "1", ",", "1", ",", "1", ")", "\n\n", "f", ":=", "&", "Form", "{", "Box", ":", "box", ",", "itemPadding", ":", "1", ",", "...
// NewForm returns a new form.
[ "NewForm", "returns", "a", "new", "form", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L85-L101
163,916
rivo/tview
form.go
SetItemPadding
func (f *Form) SetItemPadding(padding int) *Form { f.itemPadding = padding return f }
go
func (f *Form) SetItemPadding(padding int) *Form { f.itemPadding = padding return f }
[ "func", "(", "f", "*", "Form", ")", "SetItemPadding", "(", "padding", "int", ")", "*", "Form", "{", "f", ".", "itemPadding", "=", "padding", "\n", "return", "f", "\n", "}" ]
// SetItemPadding sets the number of empty rows between form items for vertical // layouts and the number of empty cells between form items for horizontal // layouts.
[ "SetItemPadding", "sets", "the", "number", "of", "empty", "rows", "between", "form", "items", "for", "vertical", "layouts", "and", "the", "number", "of", "empty", "cells", "between", "form", "items", "for", "horizontal", "layouts", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L106-L109
163,917
rivo/tview
form.go
SetLabelColor
func (f *Form) SetLabelColor(color tcell.Color) *Form { f.labelColor = color return f }
go
func (f *Form) SetLabelColor(color tcell.Color) *Form { f.labelColor = color return f }
[ "func", "(", "f", "*", "Form", ")", "SetLabelColor", "(", "color", "tcell", ".", "Color", ")", "*", "Form", "{", "f", ".", "labelColor", "=", "color", "\n", "return", "f", "\n", "}" ]
// SetLabelColor sets the color of the labels.
[ "SetLabelColor", "sets", "the", "color", "of", "the", "labels", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L121-L124
163,918
rivo/tview
form.go
SetFieldBackgroundColor
func (f *Form) SetFieldBackgroundColor(color tcell.Color) *Form { f.fieldBackgroundColor = color return f }
go
func (f *Form) SetFieldBackgroundColor(color tcell.Color) *Form { f.fieldBackgroundColor = color return f }
[ "func", "(", "f", "*", "Form", ")", "SetFieldBackgroundColor", "(", "color", "tcell", ".", "Color", ")", "*", "Form", "{", "f", ".", "fieldBackgroundColor", "=", "color", "\n", "return", "f", "\n", "}" ]
// SetFieldBackgroundColor sets the background color of the input areas.
[ "SetFieldBackgroundColor", "sets", "the", "background", "color", "of", "the", "input", "areas", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L127-L130
163,919
rivo/tview
form.go
SetFieldTextColor
func (f *Form) SetFieldTextColor(color tcell.Color) *Form { f.fieldTextColor = color return f }
go
func (f *Form) SetFieldTextColor(color tcell.Color) *Form { f.fieldTextColor = color return f }
[ "func", "(", "f", "*", "Form", ")", "SetFieldTextColor", "(", "color", "tcell", ".", "Color", ")", "*", "Form", "{", "f", ".", "fieldTextColor", "=", "color", "\n", "return", "f", "\n", "}" ]
// SetFieldTextColor sets the text color of the input areas.
[ "SetFieldTextColor", "sets", "the", "text", "color", "of", "the", "input", "areas", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L133-L136
163,920
rivo/tview
form.go
SetButtonBackgroundColor
func (f *Form) SetButtonBackgroundColor(color tcell.Color) *Form { f.buttonBackgroundColor = color return f }
go
func (f *Form) SetButtonBackgroundColor(color tcell.Color) *Form { f.buttonBackgroundColor = color return f }
[ "func", "(", "f", "*", "Form", ")", "SetButtonBackgroundColor", "(", "color", "tcell", ".", "Color", ")", "*", "Form", "{", "f", ".", "buttonBackgroundColor", "=", "color", "\n", "return", "f", "\n", "}" ]
// SetButtonBackgroundColor sets the background color of the buttons.
[ "SetButtonBackgroundColor", "sets", "the", "background", "color", "of", "the", "buttons", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L146-L149
163,921
rivo/tview
form.go
SetButtonTextColor
func (f *Form) SetButtonTextColor(color tcell.Color) *Form { f.buttonTextColor = color return f }
go
func (f *Form) SetButtonTextColor(color tcell.Color) *Form { f.buttonTextColor = color return f }
[ "func", "(", "f", "*", "Form", ")", "SetButtonTextColor", "(", "color", "tcell", ".", "Color", ")", "*", "Form", "{", "f", ".", "buttonTextColor", "=", "color", "\n", "return", "f", "\n", "}" ]
// SetButtonTextColor sets the color of the button texts.
[ "SetButtonTextColor", "sets", "the", "color", "of", "the", "button", "texts", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L152-L155
163,922
rivo/tview
form.go
AddButton
func (f *Form) AddButton(label string, selected func()) *Form { f.buttons = append(f.buttons, NewButton(label).SetSelectedFunc(selected)) return f }
go
func (f *Form) AddButton(label string, selected func()) *Form { f.buttons = append(f.buttons, NewButton(label).SetSelectedFunc(selected)) return f }
[ "func", "(", "f", "*", "Form", ")", "AddButton", "(", "label", "string", ",", "selected", "func", "(", ")", ")", "*", "Form", "{", "f", ".", "buttons", "=", "append", "(", "f", ".", "buttons", ",", "NewButton", "(", "label", ")", ".", "SetSelectedF...
// AddButton adds a new button to the form. The "selected" function is called // when the user selects this button. It may be nil.
[ "AddButton", "adds", "a", "new", "button", "to", "the", "form", ".", "The", "selected", "function", "is", "called", "when", "the", "user", "selects", "this", "button", ".", "It", "may", "be", "nil", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L216-L219
163,923
rivo/tview
form.go
RemoveButton
func (f *Form) RemoveButton(index int) *Form { f.buttons = append(f.buttons[:index], f.buttons[index+1:]...) return f }
go
func (f *Form) RemoveButton(index int) *Form { f.buttons = append(f.buttons[:index], f.buttons[index+1:]...) return f }
[ "func", "(", "f", "*", "Form", ")", "RemoveButton", "(", "index", "int", ")", "*", "Form", "{", "f", ".", "buttons", "=", "append", "(", "f", ".", "buttons", "[", ":", "index", "]", ",", "f", ".", "buttons", "[", "index", "+", "1", ":", "]", ...
// RemoveButton removes the button at the specified position, starting with 0 // for the button that was added first.
[ "RemoveButton", "removes", "the", "button", "at", "the", "specified", "position", "starting", "with", "0", "for", "the", "button", "that", "was", "added", "first", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L230-L233
163,924
rivo/tview
form.go
GetButtonIndex
func (f *Form) GetButtonIndex(label string) int { for index, button := range f.buttons { if button.GetLabel() == label { return index } } return -1 }
go
func (f *Form) GetButtonIndex(label string) int { for index, button := range f.buttons { if button.GetLabel() == label { return index } } return -1 }
[ "func", "(", "f", "*", "Form", ")", "GetButtonIndex", "(", "label", "string", ")", "int", "{", "for", "index", ",", "button", ":=", "range", "f", ".", "buttons", "{", "if", "button", ".", "GetLabel", "(", ")", "==", "label", "{", "return", "index", ...
// GetButtonIndex returns the index of the button with the given label, starting // with 0 for the button that was added first. If no such label was found, -1 // is returned.
[ "GetButtonIndex", "returns", "the", "index", "of", "the", "button", "with", "the", "given", "label", "starting", "with", "0", "for", "the", "button", "that", "was", "added", "first", ".", "If", "no", "such", "label", "was", "found", "-", "1", "is", "retu...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L243-L250
163,925
rivo/tview
form.go
Clear
func (f *Form) Clear(includeButtons bool) *Form { f.items = nil if includeButtons { f.buttons = nil } f.focusedElement = 0 return f }
go
func (f *Form) Clear(includeButtons bool) *Form { f.items = nil if includeButtons { f.buttons = nil } f.focusedElement = 0 return f }
[ "func", "(", "f", "*", "Form", ")", "Clear", "(", "includeButtons", "bool", ")", "*", "Form", "{", "f", ".", "items", "=", "nil", "\n", "if", "includeButtons", "{", "f", ".", "buttons", "=", "nil", "\n", "}", "\n", "f", ".", "focusedElement", "=", ...
// Clear removes all input elements from the form, including the buttons if // specified.
[ "Clear", "removes", "all", "input", "elements", "from", "the", "form", "including", "the", "buttons", "if", "specified", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L254-L261
163,926
rivo/tview
form.go
RemoveFormItem
func (f *Form) RemoveFormItem(index int) *Form { f.items = append(f.items[:index], f.items[index+1:]...) return f }
go
func (f *Form) RemoveFormItem(index int) *Form { f.items = append(f.items[:index], f.items[index+1:]...) return f }
[ "func", "(", "f", "*", "Form", ")", "RemoveFormItem", "(", "index", "int", ")", "*", "Form", "{", "f", ".", "items", "=", "append", "(", "f", ".", "items", "[", ":", "index", "]", ",", "f", ".", "items", "[", "index", "+", "1", ":", "]", "......
// RemoveFormItem removes the form element at the given position, starting with // index 0. Elements are referenced in the order they were added. Buttons are // not included.
[ "RemoveFormItem", "removes", "the", "form", "element", "at", "the", "given", "position", "starting", "with", "index", "0", ".", "Elements", "are", "referenced", "in", "the", "order", "they", "were", "added", ".", "Buttons", "are", "not", "included", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L288-L291
163,927
rivo/tview
form.go
GetFormItemByLabel
func (f *Form) GetFormItemByLabel(label string) FormItem { for _, item := range f.items { if item.GetLabel() == label { return item } } return nil }
go
func (f *Form) GetFormItemByLabel(label string) FormItem { for _, item := range f.items { if item.GetLabel() == label { return item } } return nil }
[ "func", "(", "f", "*", "Form", ")", "GetFormItemByLabel", "(", "label", "string", ")", "FormItem", "{", "for", "_", ",", "item", ":=", "range", "f", ".", "items", "{", "if", "item", ".", "GetLabel", "(", ")", "==", "label", "{", "return", "item", "...
// GetFormItemByLabel returns the first form element with the given label. If // no such element is found, nil is returned. Buttons are not searched and will // therefore not be returned.
[ "GetFormItemByLabel", "returns", "the", "first", "form", "element", "with", "the", "given", "label", ".", "If", "no", "such", "element", "is", "found", "nil", "is", "returned", ".", "Buttons", "are", "not", "searched", "and", "will", "therefore", "not", "be"...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L296-L303
163,928
rivo/tview
form.go
GetFormItemIndex
func (f *Form) GetFormItemIndex(label string) int { for index, item := range f.items { if item.GetLabel() == label { return index } } return -1 }
go
func (f *Form) GetFormItemIndex(label string) int { for index, item := range f.items { if item.GetLabel() == label { return index } } return -1 }
[ "func", "(", "f", "*", "Form", ")", "GetFormItemIndex", "(", "label", "string", ")", "int", "{", "for", "index", ",", "item", ":=", "range", "f", ".", "items", "{", "if", "item", ".", "GetLabel", "(", ")", "==", "label", "{", "return", "index", "\n...
// GetFormItemIndex returns the index of the first form element with the given // label. If no such element is found, -1 is returned. Buttons are not searched // and will therefore not be returned.
[ "GetFormItemIndex", "returns", "the", "index", "of", "the", "first", "form", "element", "with", "the", "given", "label", ".", "If", "no", "such", "element", "is", "found", "-", "1", "is", "returned", ".", "Buttons", "are", "not", "searched", "and", "will",...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/form.go#L308-L315
163,929
rivo/tview
demos/presentation/end.go
End
func End(nextSlide func()) (title string, content tview.Primitive) { textView := tview.NewTextView().SetDoneFunc(func(key tcell.Key) { nextSlide() }) url := "https://github.com/rivo/tview" fmt.Fprint(textView, url) return "End", Center(len(url), 1, textView) }
go
func End(nextSlide func()) (title string, content tview.Primitive) { textView := tview.NewTextView().SetDoneFunc(func(key tcell.Key) { nextSlide() }) url := "https://github.com/rivo/tview" fmt.Fprint(textView, url) return "End", Center(len(url), 1, textView) }
[ "func", "End", "(", "nextSlide", "func", "(", ")", ")", "(", "title", "string", ",", "content", "tview", ".", "Primitive", ")", "{", "textView", ":=", "tview", ".", "NewTextView", "(", ")", ".", "SetDoneFunc", "(", "func", "(", "key", "tcell", ".", "...
// End shows the final slide.
[ "End", "shows", "the", "final", "slide", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/demos/presentation/end.go#L11-L18
163,930
rivo/tview
semigraphics.go
PrintJoinedSemigraphics
func PrintJoinedSemigraphics(screen tcell.Screen, x, y int, ch rune, color tcell.Color) { previous, _, style, _ := screen.GetContent(x, y) style = style.Foreground(color) // What's the resulting rune? var result rune if ch == previous { result = ch } else { if ch < previous { previous, ch = ch, previous ...
go
func PrintJoinedSemigraphics(screen tcell.Screen, x, y int, ch rune, color tcell.Color) { previous, _, style, _ := screen.GetContent(x, y) style = style.Foreground(color) // What's the resulting rune? var result rune if ch == previous { result = ch } else { if ch < previous { previous, ch = ch, previous ...
[ "func", "PrintJoinedSemigraphics", "(", "screen", "tcell", ".", "Screen", ",", "x", ",", "y", "int", ",", "ch", "rune", ",", "color", "tcell", ".", "Color", ")", "{", "previous", ",", "_", ",", "style", ",", "_", ":=", "screen", ".", "GetContent", "(...
// PrintJoinedSemigraphics prints a semigraphics rune into the screen at the given // position with the given color, joining it with any existing semigraphics // rune. Background colors are preserved. At this point, only regular single // line borders are supported.
[ "PrintJoinedSemigraphics", "prints", "a", "semigraphics", "rune", "into", "the", "screen", "at", "the", "given", "position", "with", "the", "given", "color", "joining", "it", "with", "any", "existing", "semigraphics", "rune", ".", "Background", "colors", "are", ...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/semigraphics.go#L276-L296
163,931
rivo/tview
application.go
NewApplication
func NewApplication() *Application { return &Application{ events: make(chan tcell.Event, queueSize), updates: make(chan func(), queueSize), screenReplacement: make(chan tcell.Screen, 1), } }
go
func NewApplication() *Application { return &Application{ events: make(chan tcell.Event, queueSize), updates: make(chan func(), queueSize), screenReplacement: make(chan tcell.Screen, 1), } }
[ "func", "NewApplication", "(", ")", "*", "Application", "{", "return", "&", "Application", "{", "events", ":", "make", "(", "chan", "tcell", ".", "Event", ",", "queueSize", ")", ",", "updates", ":", "make", "(", "chan", "func", "(", ")", ",", "queueSiz...
// NewApplication creates and returns a new application.
[ "NewApplication", "creates", "and", "returns", "a", "new", "application", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/application.go#L68-L74
163,932
rivo/tview
application.go
Suspend
func (a *Application) Suspend(f func()) bool { a.RLock() screen := a.screen a.RUnlock() if screen == nil { return false // Screen has not yet been initialized. } // Enter suspended mode. screen.Fini() // Wait for "f" to return. f() // Make a new screen. var err error screen, err = tcell.NewScreen() if...
go
func (a *Application) Suspend(f func()) bool { a.RLock() screen := a.screen a.RUnlock() if screen == nil { return false // Screen has not yet been initialized. } // Enter suspended mode. screen.Fini() // Wait for "f" to return. f() // Make a new screen. var err error screen, err = tcell.NewScreen() if...
[ "func", "(", "a", "*", "Application", ")", "Suspend", "(", "f", "func", "(", ")", ")", "bool", "{", "a", ".", "RLock", "(", ")", "\n", "screen", ":=", "a", ".", "screen", "\n", "a", ".", "RUnlock", "(", ")", "\n", "if", "screen", "==", "nil", ...
// Suspend temporarily suspends the application by exiting terminal UI mode and // invoking the provided function "f". When "f" returns, terminal UI mode is // entered again and the application resumes. // // A return value of true indicates that the application was suspended and "f" // was called. If false is returned...
[ "Suspend", "temporarily", "suspends", "the", "application", "by", "exiting", "terminal", "UI", "mode", "and", "invoking", "the", "provided", "function", "f", ".", "When", "f", "returns", "terminal", "UI", "mode", "is", "entered", "again", "and", "the", "applic...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/application.go#L284-L309
163,933
rivo/tview
application.go
SetAfterDrawFunc
func (a *Application) SetAfterDrawFunc(handler func(screen tcell.Screen)) *Application { a.afterDraw = handler return a }
go
func (a *Application) SetAfterDrawFunc(handler func(screen tcell.Screen)) *Application { a.afterDraw = handler return a }
[ "func", "(", "a", "*", "Application", ")", "SetAfterDrawFunc", "(", "handler", "func", "(", "screen", "tcell", ".", "Screen", ")", ")", "*", "Application", "{", "a", ".", "afterDraw", "=", "handler", "\n", "return", "a", "\n", "}" ]
// SetAfterDrawFunc installs a callback function which is invoked after the root // primitive was drawn during screen updates. // // Provide nil to uninstall the callback function.
[ "SetAfterDrawFunc", "installs", "a", "callback", "function", "which", "is", "invoked", "after", "the", "root", "primitive", "was", "drawn", "during", "screen", "updates", ".", "Provide", "nil", "to", "uninstall", "the", "callback", "function", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/application.go#L400-L403
163,934
rivo/tview
application.go
ResizeToFullScreen
func (a *Application) ResizeToFullScreen(p Primitive) *Application { a.RLock() width, height := a.screen.Size() a.RUnlock() p.SetRect(0, 0, width, height) return a }
go
func (a *Application) ResizeToFullScreen(p Primitive) *Application { a.RLock() width, height := a.screen.Size() a.RUnlock() p.SetRect(0, 0, width, height) return a }
[ "func", "(", "a", "*", "Application", ")", "ResizeToFullScreen", "(", "p", "Primitive", ")", "*", "Application", "{", "a", ".", "RLock", "(", ")", "\n", "width", ",", "height", ":=", "a", ".", "screen", ".", "Size", "(", ")", "\n", "a", ".", "RUnlo...
// ResizeToFullScreen resizes the given primitive such that it fills the entire // screen.
[ "ResizeToFullScreen", "resizes", "the", "given", "primitive", "such", "that", "it", "fills", "the", "entire", "screen", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/application.go#L434-L440
163,935
rivo/tview
application.go
GetFocus
func (a *Application) GetFocus() Primitive { a.RLock() defer a.RUnlock() return a.focus }
go
func (a *Application) GetFocus() Primitive { a.RLock() defer a.RUnlock() return a.focus }
[ "func", "(", "a", "*", "Application", ")", "GetFocus", "(", ")", "Primitive", "{", "a", ".", "RLock", "(", ")", "\n", "defer", "a", ".", "RUnlock", "(", ")", "\n", "return", "a", ".", "focus", "\n", "}" ]
// GetFocus returns the primitive which has the current focus. If none has it, // nil is returned.
[ "GetFocus", "returns", "the", "primitive", "which", "has", "the", "current", "focus", ".", "If", "none", "has", "it", "nil", "is", "returned", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/application.go#L469-L473
163,936
rivo/tview
application.go
QueueEvent
func (a *Application) QueueEvent(event tcell.Event) *Application { a.events <- event return a }
go
func (a *Application) QueueEvent(event tcell.Event) *Application { a.events <- event return a }
[ "func", "(", "a", "*", "Application", ")", "QueueEvent", "(", "event", "tcell", ".", "Event", ")", "*", "Application", "{", "a", ".", "events", "<-", "event", "\n", "return", "a", "\n", "}" ]
// QueueEvent sends an event to the Application event loop. // // It is not recommended for event to be nil.
[ "QueueEvent", "sends", "an", "event", "to", "the", "Application", "event", "loop", ".", "It", "is", "not", "recommended", "for", "event", "to", "be", "nil", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/application.go#L502-L505
163,937
rivo/tview
pages.go
NewPages
func NewPages() *Pages { p := &Pages{ Box: NewBox(), } p.focus = p return p }
go
func NewPages() *Pages { p := &Pages{ Box: NewBox(), } p.focus = p return p }
[ "func", "NewPages", "(", ")", "*", "Pages", "{", "p", ":=", "&", "Pages", "{", "Box", ":", "NewBox", "(", ")", ",", "}", "\n", "p", ".", "focus", "=", "p", "\n", "return", "p", "\n", "}" ]
// NewPages returns a new Pages object.
[ "NewPages", "returns", "a", "new", "Pages", "object", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/pages.go#L36-L42
163,938
rivo/tview
pages.go
RemovePage
func (p *Pages) RemovePage(name string) *Pages { var isVisible bool hasFocus := p.HasFocus() for index, page := range p.pages { if page.Name == name { isVisible = page.Visible p.pages = append(p.pages[:index], p.pages[index+1:]...) if page.Visible && p.changed != nil { p.changed() } break } }...
go
func (p *Pages) RemovePage(name string) *Pages { var isVisible bool hasFocus := p.HasFocus() for index, page := range p.pages { if page.Name == name { isVisible = page.Visible p.pages = append(p.pages[:index], p.pages[index+1:]...) if page.Visible && p.changed != nil { p.changed() } break } }...
[ "func", "(", "p", "*", "Pages", ")", "RemovePage", "(", "name", "string", ")", "*", "Pages", "{", "var", "isVisible", "bool", "\n", "hasFocus", ":=", "p", ".", "HasFocus", "(", ")", "\n", "for", "index", ",", "page", ":=", "range", "p", ".", "pages...
// RemovePage removes the page with the given name. If that page was the only // visible page, visibility is assigned to the last page.
[ "RemovePage", "removes", "the", "page", "with", "the", "given", "name", ".", "If", "that", "page", "was", "the", "only", "visible", "page", "visibility", "is", "assigned", "to", "the", "last", "page", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/pages.go#L88-L116
163,939
rivo/tview
pages.go
HasPage
func (p *Pages) HasPage(name string) bool { for _, page := range p.pages { if page.Name == name { return true } } return false }
go
func (p *Pages) HasPage(name string) bool { for _, page := range p.pages { if page.Name == name { return true } } return false }
[ "func", "(", "p", "*", "Pages", ")", "HasPage", "(", "name", "string", ")", "bool", "{", "for", "_", ",", "page", ":=", "range", "p", ".", "pages", "{", "if", "page", ".", "Name", "==", "name", "{", "return", "true", "\n", "}", "\n", "}", "\n",...
// HasPage returns true if a page with the given name exists in this object.
[ "HasPage", "returns", "true", "if", "a", "page", "with", "the", "given", "name", "exists", "in", "this", "object", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/pages.go#L119-L126
163,940
rivo/tview
textview.go
NewTextView
func NewTextView() *TextView { return &TextView{ Box: NewBox(), highlights: make(map[string]struct{}), lineOffset: -1, scrollable: true, align: AlignLeft, wrap: true, textColor: Styles.PrimaryTextColor, regions: false, dynamicColors: false, } }
go
func NewTextView() *TextView { return &TextView{ Box: NewBox(), highlights: make(map[string]struct{}), lineOffset: -1, scrollable: true, align: AlignLeft, wrap: true, textColor: Styles.PrimaryTextColor, regions: false, dynamicColors: false, } }
[ "func", "NewTextView", "(", ")", "*", "TextView", "{", "return", "&", "TextView", "{", "Box", ":", "NewBox", "(", ")", ",", "highlights", ":", "make", "(", "map", "[", "string", "]", "struct", "{", "}", ")", ",", "lineOffset", ":", "-", "1", ",", ...
// NewTextView returns a new text view.
[ "NewTextView", "returns", "a", "new", "text", "view", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L175-L187
163,941
rivo/tview
textview.go
SetScrollable
func (t *TextView) SetScrollable(scrollable bool) *TextView { t.scrollable = scrollable if !scrollable { t.trackEnd = true } return t }
go
func (t *TextView) SetScrollable(scrollable bool) *TextView { t.scrollable = scrollable if !scrollable { t.trackEnd = true } return t }
[ "func", "(", "t", "*", "TextView", ")", "SetScrollable", "(", "scrollable", "bool", ")", "*", "TextView", "{", "t", ".", "scrollable", "=", "scrollable", "\n", "if", "!", "scrollable", "{", "t", ".", "trackEnd", "=", "true", "\n", "}", "\n", "return", ...
// SetScrollable sets the flag that decides whether or not the text view is // scrollable. If true, text is kept in a buffer and can be navigated.
[ "SetScrollable", "sets", "the", "flag", "that", "decides", "whether", "or", "not", "the", "text", "view", "is", "scrollable", ".", "If", "true", "text", "is", "kept", "in", "a", "buffer", "and", "can", "be", "navigated", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L191-L197
163,942
rivo/tview
textview.go
SetWrap
func (t *TextView) SetWrap(wrap bool) *TextView { if t.wrap != wrap { t.index = nil } t.wrap = wrap return t }
go
func (t *TextView) SetWrap(wrap bool) *TextView { if t.wrap != wrap { t.index = nil } t.wrap = wrap return t }
[ "func", "(", "t", "*", "TextView", ")", "SetWrap", "(", "wrap", "bool", ")", "*", "TextView", "{", "if", "t", ".", "wrap", "!=", "wrap", "{", "t", ".", "index", "=", "nil", "\n", "}", "\n", "t", ".", "wrap", "=", "wrap", "\n", "return", "t", ...
// SetWrap sets the flag that, if true, leads to lines that are longer than the // available width being wrapped onto the next line. If false, any characters // beyond the available width are not displayed.
[ "SetWrap", "sets", "the", "flag", "that", "if", "true", "leads", "to", "lines", "that", "are", "longer", "than", "the", "available", "width", "being", "wrapped", "onto", "the", "next", "line", ".", "If", "false", "any", "characters", "beyond", "the", "avai...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L202-L208
163,943
rivo/tview
textview.go
SetTextAlign
func (t *TextView) SetTextAlign(align int) *TextView { if t.align != align { t.index = nil } t.align = align return t }
go
func (t *TextView) SetTextAlign(align int) *TextView { if t.align != align { t.index = nil } t.align = align return t }
[ "func", "(", "t", "*", "TextView", ")", "SetTextAlign", "(", "align", "int", ")", "*", "TextView", "{", "if", "t", ".", "align", "!=", "align", "{", "t", ".", "index", "=", "nil", "\n", "}", "\n", "t", ".", "align", "=", "align", "\n", "return", ...
// SetTextAlign sets the text alignment within the text view. This must be // either AlignLeft, AlignCenter, or AlignRight.
[ "SetTextAlign", "sets", "the", "text", "alignment", "within", "the", "text", "view", ".", "This", "must", "be", "either", "AlignLeft", "AlignCenter", "or", "AlignRight", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L225-L231
163,944
rivo/tview
textview.go
SetText
func (t *TextView) SetText(text string) *TextView { t.Clear() fmt.Fprint(t, text) return t }
go
func (t *TextView) SetText(text string) *TextView { t.Clear() fmt.Fprint(t, text) return t }
[ "func", "(", "t", "*", "TextView", ")", "SetText", "(", "text", "string", ")", "*", "TextView", "{", "t", ".", "Clear", "(", ")", "\n", "fmt", ".", "Fprint", "(", "t", ",", "text", ")", "\n", "return", "t", "\n", "}" ]
// SetText sets the text of this text view to the provided string. Previously // contained text will be removed.
[ "SetText", "sets", "the", "text", "of", "this", "text", "view", "to", "the", "provided", "string", ".", "Previously", "contained", "text", "will", "be", "removed", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L243-L247
163,945
rivo/tview
textview.go
SetDynamicColors
func (t *TextView) SetDynamicColors(dynamic bool) *TextView { if t.dynamicColors != dynamic { t.index = nil } t.dynamicColors = dynamic return t }
go
func (t *TextView) SetDynamicColors(dynamic bool) *TextView { if t.dynamicColors != dynamic { t.index = nil } t.dynamicColors = dynamic return t }
[ "func", "(", "t", "*", "TextView", ")", "SetDynamicColors", "(", "dynamic", "bool", ")", "*", "TextView", "{", "if", "t", ".", "dynamicColors", "!=", "dynamic", "{", "t", ".", "index", "=", "nil", "\n", "}", "\n", "t", ".", "dynamicColors", "=", "dyn...
// SetDynamicColors sets the flag that allows the text color to be changed // dynamically. See class description for details.
[ "SetDynamicColors", "sets", "the", "flag", "that", "allows", "the", "text", "color", "to", "be", "changed", "dynamically", ".", "See", "class", "description", "for", "details", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L279-L285
163,946
rivo/tview
textview.go
SetRegions
func (t *TextView) SetRegions(regions bool) *TextView { if t.regions != regions { t.index = nil } t.regions = regions return t }
go
func (t *TextView) SetRegions(regions bool) *TextView { if t.regions != regions { t.index = nil } t.regions = regions return t }
[ "func", "(", "t", "*", "TextView", ")", "SetRegions", "(", "regions", "bool", ")", "*", "TextView", "{", "if", "t", ".", "regions", "!=", "regions", "{", "t", ".", "index", "=", "nil", "\n", "}", "\n", "t", ".", "regions", "=", "regions", "\n", "...
// SetRegions sets the flag that allows to define regions in the text. See class // description for details.
[ "SetRegions", "sets", "the", "flag", "that", "allows", "to", "define", "regions", "in", "the", "text", ".", "See", "class", "description", "for", "details", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L289-L295
163,947
rivo/tview
textview.go
ScrollToBeginning
func (t *TextView) ScrollToBeginning() *TextView { if !t.scrollable { return t } t.trackEnd = false t.lineOffset = 0 t.columnOffset = 0 return t }
go
func (t *TextView) ScrollToBeginning() *TextView { if !t.scrollable { return t } t.trackEnd = false t.lineOffset = 0 t.columnOffset = 0 return t }
[ "func", "(", "t", "*", "TextView", ")", "ScrollToBeginning", "(", ")", "*", "TextView", "{", "if", "!", "t", ".", "scrollable", "{", "return", "t", "\n", "}", "\n", "t", ".", "trackEnd", "=", "false", "\n", "t", ".", "lineOffset", "=", "0", "\n", ...
// ScrollToBeginning scrolls to the top left corner of the text if the text view // is scrollable.
[ "ScrollToBeginning", "scrolls", "to", "the", "top", "left", "corner", "of", "the", "text", "if", "the", "text", "view", "is", "scrollable", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L337-L345
163,948
rivo/tview
textview.go
ScrollToEnd
func (t *TextView) ScrollToEnd() *TextView { if !t.scrollable { return t } t.trackEnd = true t.columnOffset = 0 return t }
go
func (t *TextView) ScrollToEnd() *TextView { if !t.scrollable { return t } t.trackEnd = true t.columnOffset = 0 return t }
[ "func", "(", "t", "*", "TextView", ")", "ScrollToEnd", "(", ")", "*", "TextView", "{", "if", "!", "t", ".", "scrollable", "{", "return", "t", "\n", "}", "\n", "t", ".", "trackEnd", "=", "true", "\n", "t", ".", "columnOffset", "=", "0", "\n", "ret...
// ScrollToEnd scrolls to the bottom left corner of the text if the text view // is scrollable. Adding new rows to the end of the text view will cause it to // scroll with the new data.
[ "ScrollToEnd", "scrolls", "to", "the", "bottom", "left", "corner", "of", "the", "text", "if", "the", "text", "view", "is", "scrollable", ".", "Adding", "new", "rows", "to", "the", "end", "of", "the", "text", "view", "will", "cause", "it", "to", "scroll",...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L350-L357
163,949
rivo/tview
textview.go
GetScrollOffset
func (t *TextView) GetScrollOffset() (row, column int) { return t.lineOffset, t.columnOffset }
go
func (t *TextView) GetScrollOffset() (row, column int) { return t.lineOffset, t.columnOffset }
[ "func", "(", "t", "*", "TextView", ")", "GetScrollOffset", "(", ")", "(", "row", ",", "column", "int", ")", "{", "return", "t", ".", "lineOffset", ",", "t", ".", "columnOffset", "\n", "}" ]
// GetScrollOffset returns the number of rows and columns that are skipped at // the top left corner when the text view has been scrolled.
[ "GetScrollOffset", "returns", "the", "number", "of", "rows", "and", "columns", "that", "are", "skipped", "at", "the", "top", "left", "corner", "when", "the", "text", "view", "has", "been", "scrolled", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L361-L363
163,950
rivo/tview
textview.go
Clear
func (t *TextView) Clear() *TextView { t.buffer = nil t.recentBytes = nil t.index = nil return t }
go
func (t *TextView) Clear() *TextView { t.buffer = nil t.recentBytes = nil t.index = nil return t }
[ "func", "(", "t", "*", "TextView", ")", "Clear", "(", ")", "*", "TextView", "{", "t", ".", "buffer", "=", "nil", "\n", "t", ".", "recentBytes", "=", "nil", "\n", "t", ".", "index", "=", "nil", "\n", "return", "t", "\n", "}" ]
// Clear removes all text from the buffer.
[ "Clear", "removes", "all", "text", "from", "the", "buffer", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L366-L371
163,951
rivo/tview
textview.go
Highlight
func (t *TextView) Highlight(regionIDs ...string) *TextView { t.highlights = make(map[string]struct{}) for _, id := range regionIDs { if id == "" { continue } t.highlights[id] = struct{}{} } t.index = nil return t }
go
func (t *TextView) Highlight(regionIDs ...string) *TextView { t.highlights = make(map[string]struct{}) for _, id := range regionIDs { if id == "" { continue } t.highlights[id] = struct{}{} } t.index = nil return t }
[ "func", "(", "t", "*", "TextView", ")", "Highlight", "(", "regionIDs", "...", "string", ")", "*", "TextView", "{", "t", ".", "highlights", "=", "make", "(", "map", "[", "string", "]", "struct", "{", "}", ")", "\n", "for", "_", ",", "id", ":=", "r...
// Highlight specifies which regions should be highlighted. See class // description for details on regions. Empty region strings are ignored. // // Text in highlighted regions will be drawn inverted, i.e. with their // background and foreground colors swapped. // // Calling this function will remove any previous highl...
[ "Highlight", "specifies", "which", "regions", "should", "be", "highlighted", ".", "See", "class", "description", "for", "details", "on", "regions", ".", "Empty", "region", "strings", "are", "ignored", ".", "Text", "in", "highlighted", "regions", "will", "be", ...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L381-L391
163,952
rivo/tview
textview.go
GetHighlights
func (t *TextView) GetHighlights() (regionIDs []string) { for id := range t.highlights { regionIDs = append(regionIDs, id) } return }
go
func (t *TextView) GetHighlights() (regionIDs []string) { for id := range t.highlights { regionIDs = append(regionIDs, id) } return }
[ "func", "(", "t", "*", "TextView", ")", "GetHighlights", "(", ")", "(", "regionIDs", "[", "]", "string", ")", "{", "for", "id", ":=", "range", "t", ".", "highlights", "{", "regionIDs", "=", "append", "(", "regionIDs", ",", "id", ")", "\n", "}", "\n...
// GetHighlights returns the IDs of all currently highlighted regions.
[ "GetHighlights", "returns", "the", "IDs", "of", "all", "currently", "highlighted", "regions", "." ]
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L394-L399
163,953
rivo/tview
textview.go
ScrollToHighlight
func (t *TextView) ScrollToHighlight() *TextView { if len(t.highlights) == 0 || !t.scrollable || !t.regions { return t } t.index = nil t.scrollToHighlights = true t.trackEnd = false return t }
go
func (t *TextView) ScrollToHighlight() *TextView { if len(t.highlights) == 0 || !t.scrollable || !t.regions { return t } t.index = nil t.scrollToHighlights = true t.trackEnd = false return t }
[ "func", "(", "t", "*", "TextView", ")", "ScrollToHighlight", "(", ")", "*", "TextView", "{", "if", "len", "(", "t", ".", "highlights", ")", "==", "0", "||", "!", "t", ".", "scrollable", "||", "!", "t", ".", "regions", "{", "return", "t", "\n", "}...
// ScrollToHighlight will cause the visible area to be scrolled so that the // highlighted regions appear in the visible area of the text view. This // repositioning happens the next time the text view is drawn. It happens only // once so you will need to call this function repeatedly to always keep // highlighted regi...
[ "ScrollToHighlight", "will", "cause", "the", "visible", "area", "to", "be", "scrolled", "so", "that", "the", "highlighted", "regions", "appear", "in", "the", "visible", "area", "of", "the", "text", "view", ".", "This", "repositioning", "happens", "the", "next"...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L409-L417
163,954
rivo/tview
textview.go
GetRegionText
func (t *TextView) GetRegionText(regionID string) string { if !t.regions || regionID == "" { return "" } var ( buffer bytes.Buffer currentRegionID string ) for _, str := range t.buffer { // Find all color tags in this line. var colorTagIndices [][]int if t.dynamicColors { colorTagIndices ...
go
func (t *TextView) GetRegionText(regionID string) string { if !t.regions || regionID == "" { return "" } var ( buffer bytes.Buffer currentRegionID string ) for _, str := range t.buffer { // Find all color tags in this line. var colorTagIndices [][]int if t.dynamicColors { colorTagIndices ...
[ "func", "(", "t", "*", "TextView", ")", "GetRegionText", "(", "regionID", "string", ")", "string", "{", "if", "!", "t", ".", "regions", "||", "regionID", "==", "\"", "\"", "{", "return", "\"", "\"", "\n", "}", "\n\n", "var", "(", "buffer", "bytes", ...
// GetRegionText returns the text of the region with the given ID. If dynamic // colors are enabled, color tags are stripped from the text. Newlines are // always returned as '\n' runes. // // If the region does not exist or if regions are turned off, an empty string // is returned.
[ "GetRegionText", "returns", "the", "text", "of", "the", "region", "with", "the", "given", "ID", ".", "If", "dynamic", "colors", "are", "enabled", "color", "tags", "are", "stripped", "from", "the", "text", ".", "Newlines", "are", "always", "returned", "as", ...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L425-L489
163,955
rivo/tview
textview.go
Write
func (t *TextView) Write(p []byte) (n int, err error) { // Notify at the end. t.Lock() changed := t.changed t.Unlock() if changed != nil { defer changed() // Deadlocks may occur if we lock here. } t.Lock() defer t.Unlock() // Copy data over. newBytes := append(t.recentBytes, p...) t.recentBytes = nil /...
go
func (t *TextView) Write(p []byte) (n int, err error) { // Notify at the end. t.Lock() changed := t.changed t.Unlock() if changed != nil { defer changed() // Deadlocks may occur if we lock here. } t.Lock() defer t.Unlock() // Copy data over. newBytes := append(t.recentBytes, p...) t.recentBytes = nil /...
[ "func", "(", "t", "*", "TextView", ")", "Write", "(", "p", "[", "]", "byte", ")", "(", "n", "int", ",", "err", "error", ")", "{", "// Notify at the end.", "t", ".", "Lock", "(", ")", "\n", "changed", ":=", "t", ".", "changed", "\n", "t", ".", "...
// Write lets us implement the io.Writer interface. Tab characters will be // replaced with TabSize space characters. A "\n" or "\r\n" will be interpreted // as a new line.
[ "Write", "lets", "us", "implement", "the", "io", ".", "Writer", "interface", ".", "Tab", "characters", "will", "be", "replaced", "with", "TabSize", "space", "characters", ".", "A", "\\", "n", "or", "\\", "r", "\\", "n", "will", "be", "interpreted", "as",...
90b4da1bd64ceee13d2e7d782b315b819190f7bf
https://github.com/rivo/tview/blob/90b4da1bd64ceee13d2e7d782b315b819190f7bf/textview.go#L511-L569
163,956
PuerkitoBio/goquery
manipulation.go
SetHtml
func (s *Selection) SetHtml(html string) *Selection { return setHtmlNodes(s, parseHtml(html)...) }
go
func (s *Selection) SetHtml(html string) *Selection { return setHtmlNodes(s, parseHtml(html)...) }
[ "func", "(", "s", "*", "Selection", ")", "SetHtml", "(", "html", "string", ")", "*", "Selection", "{", "return", "setHtmlNodes", "(", "s", ",", "parseHtml", "(", "html", ")", "...", ")", "\n", "}" ]
// SetHtml sets the html content of each element in the selection to // specified html string.
[ "SetHtml", "sets", "the", "html", "content", "of", "each", "element", "in", "the", "selection", "to", "specified", "html", "string", "." ]
3dcf72e6c17f694381a21592651ca1464ded0e10
https://github.com/PuerkitoBio/goquery/blob/3dcf72e6c17f694381a21592651ca1464ded0e10/manipulation.go#L275-L277
163,957
PuerkitoBio/goquery
manipulation.go
SetText
func (s *Selection) SetText(text string) *Selection { return s.SetHtml(html.EscapeString(text)) }
go
func (s *Selection) SetText(text string) *Selection { return s.SetHtml(html.EscapeString(text)) }
[ "func", "(", "s", "*", "Selection", ")", "SetText", "(", "text", "string", ")", "*", "Selection", "{", "return", "s", ".", "SetHtml", "(", "html", ".", "EscapeString", "(", "text", ")", ")", "\n", "}" ]
// SetText sets the content of each element in the selection to specified content. // The provided text string is escaped.
[ "SetText", "sets", "the", "content", "of", "each", "element", "in", "the", "selection", "to", "specified", "content", ".", "The", "provided", "text", "string", "is", "escaped", "." ]
3dcf72e6c17f694381a21592651ca1464ded0e10
https://github.com/PuerkitoBio/goquery/blob/3dcf72e6c17f694381a21592651ca1464ded0e10/manipulation.go#L281-L283
163,958
PuerkitoBio/goquery
expand.go
AddBackFiltered
func (s *Selection) AddBackFiltered(selector string) *Selection { return s.AddSelection(s.prevSel.Filter(selector)) }
go
func (s *Selection) AddBackFiltered(selector string) *Selection { return s.AddSelection(s.prevSel.Filter(selector)) }
[ "func", "(", "s", "*", "Selection", ")", "AddBackFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "return", "s", ".", "AddSelection", "(", "s", ".", "prevSel", ".", "Filter", "(", "selector", ")", ")", "\n", "}" ]
// AddBackFiltered reduces the previous set of elements on the stack to those that // match the selector string, and adds them to the current set. // It returns a new Selection object containing the current Selection combined // with the filtered previous one
[ "AddBackFiltered", "reduces", "the", "previous", "set", "of", "elements", "on", "the", "stack", "to", "those", "that", "match", "the", "selector", "string", "and", "adds", "them", "to", "the", "current", "set", ".", "It", "returns", "a", "new", "Selection", ...
3dcf72e6c17f694381a21592651ca1464ded0e10
https://github.com/PuerkitoBio/goquery/blob/3dcf72e6c17f694381a21592651ca1464ded0e10/expand.go#L60-L62
163,959
PuerkitoBio/goquery
expand.go
AddBackMatcher
func (s *Selection) AddBackMatcher(m Matcher) *Selection { return s.AddSelection(s.prevSel.FilterMatcher(m)) }
go
func (s *Selection) AddBackMatcher(m Matcher) *Selection { return s.AddSelection(s.prevSel.FilterMatcher(m)) }
[ "func", "(", "s", "*", "Selection", ")", "AddBackMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "s", ".", "AddSelection", "(", "s", ".", "prevSel", ".", "FilterMatcher", "(", "m", ")", ")", "\n", "}" ]
// AddBackMatcher reduces the previous set of elements on the stack to those that match // the mateher, and adds them to the curernt set. // It returns a new Selection object containing the current Selection combined // with the filtered previous one
[ "AddBackMatcher", "reduces", "the", "previous", "set", "of", "elements", "on", "the", "stack", "to", "those", "that", "match", "the", "mateher", "and", "adds", "them", "to", "the", "curernt", "set", ".", "It", "returns", "a", "new", "Selection", "object", ...
3dcf72e6c17f694381a21592651ca1464ded0e10
https://github.com/PuerkitoBio/goquery/blob/3dcf72e6c17f694381a21592651ca1464ded0e10/expand.go#L68-L70
163,960
brocaar/loraserver
internal/maccommand/dev_status.go
RequestDevStatus
func RequestDevStatus(ds *storage.DeviceSession) storage.MACCommandBlock { block := storage.MACCommandBlock{ CID: lorawan.DevStatusReq, MACCommands: []lorawan.MACCommand{ { CID: lorawan.DevStatusReq, }, }, } ds.LastDevStatusRequested = time.Now() log.WithFields(log.Fields{ "dev_eui": ds.DevEUI, }...
go
func RequestDevStatus(ds *storage.DeviceSession) storage.MACCommandBlock { block := storage.MACCommandBlock{ CID: lorawan.DevStatusReq, MACCommands: []lorawan.MACCommand{ { CID: lorawan.DevStatusReq, }, }, } ds.LastDevStatusRequested = time.Now() log.WithFields(log.Fields{ "dev_eui": ds.DevEUI, }...
[ "func", "RequestDevStatus", "(", "ds", "*", "storage", ".", "DeviceSession", ")", "storage", ".", "MACCommandBlock", "{", "block", ":=", "storage", ".", "MACCommandBlock", "{", "CID", ":", "lorawan", ".", "DevStatusReq", ",", "MACCommands", ":", "[", "]", "l...
// RequestDevStatus returns a mac-command block for requesting the device-status.
[ "RequestDevStatus", "returns", "a", "mac", "-", "command", "block", "for", "requesting", "the", "device", "-", "status", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/maccommand/dev_status.go#L16-L30
163,961
brocaar/loraserver
internal/storage/service_profile.go
CreateServiceProfileCache
func CreateServiceProfileCache(p *redis.Pool, sp ServiceProfile) error { var buf bytes.Buffer if err := gob.NewEncoder(&buf).Encode(sp); err != nil { return errors.Wrap(err, "gob encode service-profile error") } c := p.Get() defer c.Close() key := fmt.Sprintf(ServiceProfileKeyTempl, sp.ID) exp := int64(devic...
go
func CreateServiceProfileCache(p *redis.Pool, sp ServiceProfile) error { var buf bytes.Buffer if err := gob.NewEncoder(&buf).Encode(sp); err != nil { return errors.Wrap(err, "gob encode service-profile error") } c := p.Get() defer c.Close() key := fmt.Sprintf(ServiceProfileKeyTempl, sp.ID) exp := int64(devic...
[ "func", "CreateServiceProfileCache", "(", "p", "*", "redis", ".", "Pool", ",", "sp", "ServiceProfile", ")", "error", "{", "var", "buf", "bytes", ".", "Buffer", "\n", "if", "err", ":=", "gob", ".", "NewEncoder", "(", "&", "buf", ")", ".", "Encode", "(",...
// CreateServiceProfileCache caches the given service-profile into the Redis. // This is used for faster lookups, but also in case of roaming where we // only want to store the service-profile of a roaming device for a finite // duration. // The TTL of the service-profile is the same as that of the device-sessions.
[ "CreateServiceProfileCache", "caches", "the", "given", "service", "-", "profile", "into", "the", "Redis", ".", "This", "is", "used", "for", "faster", "lookups", "but", "also", "in", "case", "of", "roaming", "where", "we", "only", "want", "to", "store", "the"...
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/storage/service_profile.go#L136-L154
163,962
brocaar/loraserver
internal/storage/service_profile.go
GetServiceProfileCache
func GetServiceProfileCache(p *redis.Pool, id uuid.UUID) (ServiceProfile, error) { var sp ServiceProfile key := fmt.Sprintf(ServiceProfileKeyTempl, id) c := p.Get() defer c.Close() val, err := redis.Bytes(c.Do("GET", key)) if err != nil { if err == redis.ErrNil { return sp, ErrDoesNotExist } return sp,...
go
func GetServiceProfileCache(p *redis.Pool, id uuid.UUID) (ServiceProfile, error) { var sp ServiceProfile key := fmt.Sprintf(ServiceProfileKeyTempl, id) c := p.Get() defer c.Close() val, err := redis.Bytes(c.Do("GET", key)) if err != nil { if err == redis.ErrNil { return sp, ErrDoesNotExist } return sp,...
[ "func", "GetServiceProfileCache", "(", "p", "*", "redis", ".", "Pool", ",", "id", "uuid", ".", "UUID", ")", "(", "ServiceProfile", ",", "error", ")", "{", "var", "sp", "ServiceProfile", "\n", "key", ":=", "fmt", ".", "Sprintf", "(", "ServiceProfileKeyTempl...
// GetServiceProfileCache returns a cached service-profile.
[ "GetServiceProfileCache", "returns", "a", "cached", "service", "-", "profile", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/storage/service_profile.go#L157-L178
163,963
brocaar/loraserver
internal/storage/service_profile.go
FlushServiceProfileCache
func FlushServiceProfileCache(p *redis.Pool, id uuid.UUID) error { key := fmt.Sprintf(ServiceProfileKeyTempl, id) c := p.Get() defer c.Close() _, err := c.Do("DEL", key) if err != nil { return errors.Wrap(err, "delete error") } return nil }
go
func FlushServiceProfileCache(p *redis.Pool, id uuid.UUID) error { key := fmt.Sprintf(ServiceProfileKeyTempl, id) c := p.Get() defer c.Close() _, err := c.Do("DEL", key) if err != nil { return errors.Wrap(err, "delete error") } return nil }
[ "func", "FlushServiceProfileCache", "(", "p", "*", "redis", ".", "Pool", ",", "id", "uuid", ".", "UUID", ")", "error", "{", "key", ":=", "fmt", ".", "Sprintf", "(", "ServiceProfileKeyTempl", ",", "id", ")", "\n", "c", ":=", "p", ".", "Get", "(", ")",...
// FlushServiceProfileCache deletes a cached service-profile.
[ "FlushServiceProfileCache", "deletes", "a", "cached", "service", "-", "profile", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/storage/service_profile.go#L181-L191
163,964
brocaar/loraserver
internal/storage/service_profile.go
GetAndCacheServiceProfile
func GetAndCacheServiceProfile(db sqlx.Queryer, p *redis.Pool, id uuid.UUID) (ServiceProfile, error) { sp, err := GetServiceProfileCache(p, id) if err == nil { return sp, nil } if err != ErrDoesNotExist { log.WithFields(log.Fields{ "id": id, }).WithError(err).Error("get service-profile cache error") // ...
go
func GetAndCacheServiceProfile(db sqlx.Queryer, p *redis.Pool, id uuid.UUID) (ServiceProfile, error) { sp, err := GetServiceProfileCache(p, id) if err == nil { return sp, nil } if err != ErrDoesNotExist { log.WithFields(log.Fields{ "id": id, }).WithError(err).Error("get service-profile cache error") // ...
[ "func", "GetAndCacheServiceProfile", "(", "db", "sqlx", ".", "Queryer", ",", "p", "*", "redis", ".", "Pool", ",", "id", "uuid", ".", "UUID", ")", "(", "ServiceProfile", ",", "error", ")", "{", "sp", ",", "err", ":=", "GetServiceProfileCache", "(", "p", ...
// GetAndCacheServiceProfile returns the service-profile from cache in case // available, else it will be retrieved from the database and then stored // in cache.
[ "GetAndCacheServiceProfile", "returns", "the", "service", "-", "profile", "from", "cache", "in", "case", "available", "else", "it", "will", "be", "retrieved", "from", "the", "database", "and", "then", "stored", "in", "cache", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/storage/service_profile.go#L196-L222
163,965
brocaar/loraserver
internal/storage/service_profile.go
UpdateServiceProfile
func UpdateServiceProfile(db sqlx.Execer, sp *ServiceProfile) error { sp.UpdatedAt = time.Now() res, err := db.Exec(` update service_profile set updated_at = $2, ul_rate = $3, ul_bucket_size = $4, ul_rate_policy = $5, dl_rate = $6, dl_bucket_size = $7, dl_rate_policy = $8, add_gw_metadata ...
go
func UpdateServiceProfile(db sqlx.Execer, sp *ServiceProfile) error { sp.UpdatedAt = time.Now() res, err := db.Exec(` update service_profile set updated_at = $2, ul_rate = $3, ul_bucket_size = $4, ul_rate_policy = $5, dl_rate = $6, dl_bucket_size = $7, dl_rate_policy = $8, add_gw_metadata ...
[ "func", "UpdateServiceProfile", "(", "db", "sqlx", ".", "Execer", ",", "sp", "*", "ServiceProfile", ")", "error", "{", "sp", ".", "UpdatedAt", "=", "time", ".", "Now", "(", ")", "\n\n", "res", ",", "err", ":=", "db", ".", "Exec", "(", "`\n\t\tupdate se...
// UpdateServiceProfile updates the given service-profile.
[ "UpdateServiceProfile", "updates", "the", "given", "service", "-", "profile", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/storage/service_profile.go#L236-L299
163,966
brocaar/loraserver
internal/storage/db.go
Beginx
func (db *DBLogger) Beginx() (*TxLogger, error) { tx, err := db.DB.Beginx() return &TxLogger{tx}, err }
go
func (db *DBLogger) Beginx() (*TxLogger, error) { tx, err := db.DB.Beginx() return &TxLogger{tx}, err }
[ "func", "(", "db", "*", "DBLogger", ")", "Beginx", "(", ")", "(", "*", "TxLogger", ",", "error", ")", "{", "tx", ",", "err", ":=", "db", ".", "DB", ".", "Beginx", "(", ")", "\n", "return", "&", "TxLogger", "{", "tx", "}", ",", "err", "\n", "}...
// Beginx returns a transaction with logging.
[ "Beginx", "returns", "a", "transaction", "with", "logging", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/storage/db.go#L34-L37
163,967
brocaar/loraserver
internal/maccommand/rx_timing_setup.go
RequestRXTimingSetup
func RequestRXTimingSetup(del int) storage.MACCommandBlock { return storage.MACCommandBlock{ CID: lorawan.RXTimingSetupReq, MACCommands: []lorawan.MACCommand{ { CID: lorawan.RXTimingSetupReq, Payload: &lorawan.RXTimingSetupReqPayload{ Delay: uint8(del), }, }, }, } }
go
func RequestRXTimingSetup(del int) storage.MACCommandBlock { return storage.MACCommandBlock{ CID: lorawan.RXTimingSetupReq, MACCommands: []lorawan.MACCommand{ { CID: lorawan.RXTimingSetupReq, Payload: &lorawan.RXTimingSetupReqPayload{ Delay: uint8(del), }, }, }, } }
[ "func", "RequestRXTimingSetup", "(", "del", "int", ")", "storage", ".", "MACCommandBlock", "{", "return", "storage", ".", "MACCommandBlock", "{", "CID", ":", "lorawan", ".", "RXTimingSetupReq", ",", "MACCommands", ":", "[", "]", "lorawan", ".", "MACCommand", "...
// RequestRXTimingSetup modifies the RX delay between the end of the TX // and the opening of the first reception slot.
[ "RequestRXTimingSetup", "modifies", "the", "RX", "delay", "between", "the", "end", "of", "the", "TX", "and", "the", "opening", "of", "the", "first", "reception", "slot", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/maccommand/rx_timing_setup.go#L13-L25
163,968
brocaar/loraserver
internal/api/network_server.go
DeleteRoutingProfile
func (n *NetworkServerAPI) DeleteRoutingProfile(ctx context.Context, req *ns.DeleteRoutingProfileRequest) (*empty.Empty, error) { var rpID uuid.UUID copy(rpID[:], req.Id) if err := storage.DeleteRoutingProfile(storage.DB(), rpID); err != nil { return nil, errToRPCError(err) } return &empty.Empty{}, nil }
go
func (n *NetworkServerAPI) DeleteRoutingProfile(ctx context.Context, req *ns.DeleteRoutingProfileRequest) (*empty.Empty, error) { var rpID uuid.UUID copy(rpID[:], req.Id) if err := storage.DeleteRoutingProfile(storage.DB(), rpID); err != nil { return nil, errToRPCError(err) } return &empty.Empty{}, nil }
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "DeleteRoutingProfile", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "DeleteRoutingProfileRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "var", "rpID", "uuid", ...
// DeleteRoutingProfile deletes the routing-profile matching the given id.
[ "DeleteRoutingProfile", "deletes", "the", "routing", "-", "profile", "matching", "the", "given", "id", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L322-L331
163,969
brocaar/loraserver
internal/api/network_server.go
CreateDeviceProfile
func (n *NetworkServerAPI) CreateDeviceProfile(ctx context.Context, req *ns.CreateDeviceProfileRequest) (*ns.CreateDeviceProfileResponse, error) { if req.DeviceProfile == nil { return nil, grpc.Errorf(codes.InvalidArgument, "device_profile must not be nil") } var dpID uuid.UUID copy(dpID[:], req.DeviceProfile.Id...
go
func (n *NetworkServerAPI) CreateDeviceProfile(ctx context.Context, req *ns.CreateDeviceProfileRequest) (*ns.CreateDeviceProfileResponse, error) { if req.DeviceProfile == nil { return nil, grpc.Errorf(codes.InvalidArgument, "device_profile must not be nil") } var dpID uuid.UUID copy(dpID[:], req.DeviceProfile.Id...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "CreateDeviceProfile", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "CreateDeviceProfileRequest", ")", "(", "*", "ns", ".", "CreateDeviceProfileResponse", ",", "error", ")", "{", "if", "re...
// CreateDeviceProfile creates the given device-profile. // The RFRegion field will get set automatically according to the configured band.
[ "CreateDeviceProfile", "creates", "the", "given", "device", "-", "profile", ".", "The", "RFRegion", "field", "will", "get", "set", "automatically", "according", "to", "the", "configured", "band", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L335-L378
163,970
brocaar/loraserver
internal/api/network_server.go
DeleteDeviceProfile
func (n *NetworkServerAPI) DeleteDeviceProfile(ctx context.Context, req *ns.DeleteDeviceProfileRequest) (*empty.Empty, error) { var dpID uuid.UUID copy(dpID[:], req.Id) if err := storage.FlushDeviceProfileCache(storage.RedisPool(), dpID); err != nil { return nil, errToRPCError(err) } if err := storage.DeleteDe...
go
func (n *NetworkServerAPI) DeleteDeviceProfile(ctx context.Context, req *ns.DeleteDeviceProfileRequest) (*empty.Empty, error) { var dpID uuid.UUID copy(dpID[:], req.Id) if err := storage.FlushDeviceProfileCache(storage.RedisPool(), dpID); err != nil { return nil, errToRPCError(err) } if err := storage.DeleteDe...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "DeleteDeviceProfile", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "DeleteDeviceProfileRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "var", "dpID", "uuid", "...
// DeleteDeviceProfile deletes the device-profile matching the given id.
[ "DeleteDeviceProfile", "deletes", "the", "device", "-", "profile", "matching", "the", "given", "id", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L485-L498
163,971
brocaar/loraserver
internal/api/network_server.go
DeactivateDevice
func (n *NetworkServerAPI) DeactivateDevice(ctx context.Context, req *ns.DeactivateDeviceRequest) (*empty.Empty, error) { var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) if err := storage.DeleteDeviceSession(storage.RedisPool(), devEUI); err != nil { return nil, errToRPCError(err) } if err := storage.Flus...
go
func (n *NetworkServerAPI) DeactivateDevice(ctx context.Context, req *ns.DeactivateDeviceRequest) (*empty.Empty, error) { var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) if err := storage.DeleteDeviceSession(storage.RedisPool(), devEUI); err != nil { return nil, errToRPCError(err) } if err := storage.Flus...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "DeactivateDevice", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "DeactivateDeviceRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "var", "devEUI", "lorawan", "....
// DeactivateDevice de-activates a device.
[ "DeactivateDevice", "de", "-", "activates", "a", "device", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L702-L715
163,972
brocaar/loraserver
internal/api/network_server.go
GetDeviceActivation
func (n *NetworkServerAPI) GetDeviceActivation(ctx context.Context, req *ns.GetDeviceActivationRequest) (*ns.GetDeviceActivationResponse, error) { var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) ds, err := storage.GetDeviceSession(storage.RedisPool(), devEUI) if err != nil { return nil, errToRPCError(err) ...
go
func (n *NetworkServerAPI) GetDeviceActivation(ctx context.Context, req *ns.GetDeviceActivationRequest) (*ns.GetDeviceActivationResponse, error) { var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) ds, err := storage.GetDeviceSession(storage.RedisPool(), devEUI) if err != nil { return nil, errToRPCError(err) ...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetDeviceActivation", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "GetDeviceActivationRequest", ")", "(", "*", "ns", ".", "GetDeviceActivationResponse", ",", "error", ")", "{", "var", "d...
// GetDeviceActivation returns the device activation details.
[ "GetDeviceActivation", "returns", "the", "device", "activation", "details", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L718-L740
163,973
brocaar/loraserver
internal/api/network_server.go
GetRandomDevAddr
func (n *NetworkServerAPI) GetRandomDevAddr(ctx context.Context, req *empty.Empty) (*ns.GetRandomDevAddrResponse, error) { devAddr, err := storage.GetRandomDevAddr(storage.RedisPool(), config.C.NetworkServer.NetID) if err != nil { return nil, errToRPCError(err) } return &ns.GetRandomDevAddrResponse{ DevAddr: d...
go
func (n *NetworkServerAPI) GetRandomDevAddr(ctx context.Context, req *empty.Empty) (*ns.GetRandomDevAddrResponse, error) { devAddr, err := storage.GetRandomDevAddr(storage.RedisPool(), config.C.NetworkServer.NetID) if err != nil { return nil, errToRPCError(err) } return &ns.GetRandomDevAddrResponse{ DevAddr: d...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetRandomDevAddr", "(", "ctx", "context", ".", "Context", ",", "req", "*", "empty", ".", "Empty", ")", "(", "*", "ns", ".", "GetRandomDevAddrResponse", ",", "error", ")", "{", "devAddr", ",", "err", ":=", ...
// GetRandomDevAddr returns a random DevAddr.
[ "GetRandomDevAddr", "returns", "a", "random", "DevAddr", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L743-L752
163,974
brocaar/loraserver
internal/api/network_server.go
CreateMACCommandQueueItem
func (n *NetworkServerAPI) CreateMACCommandQueueItem(ctx context.Context, req *ns.CreateMACCommandQueueItemRequest) (*empty.Empty, error) { var commands []lorawan.MACCommand var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) for _, b := range req.Commands { var mac lorawan.MACCommand if err := mac.Unmarshal...
go
func (n *NetworkServerAPI) CreateMACCommandQueueItem(ctx context.Context, req *ns.CreateMACCommandQueueItemRequest) (*empty.Empty, error) { var commands []lorawan.MACCommand var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) for _, b := range req.Commands { var mac lorawan.MACCommand if err := mac.Unmarshal...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "CreateMACCommandQueueItem", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "CreateMACCommandQueueItemRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "var", "commands...
// CreateMACCommandQueueItem adds a data down MAC command to the queue. // It replaces already enqueued mac-commands with the same CID.
[ "CreateMACCommandQueueItem", "adds", "a", "data", "down", "MAC", "command", "to", "the", "queue", ".", "It", "replaces", "already", "enqueued", "mac", "-", "commands", "with", "the", "same", "CID", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L756-L781
163,975
brocaar/loraserver
internal/api/network_server.go
SendProprietaryPayload
func (n *NetworkServerAPI) SendProprietaryPayload(ctx context.Context, req *ns.SendProprietaryPayloadRequest) (*empty.Empty, error) { var mic lorawan.MIC var gwIDs []lorawan.EUI64 copy(mic[:], req.Mic) for i := range req.GatewayMacs { var id lorawan.EUI64 copy(id[:], req.GatewayMacs[i]) gwIDs = append(gwIDs,...
go
func (n *NetworkServerAPI) SendProprietaryPayload(ctx context.Context, req *ns.SendProprietaryPayloadRequest) (*empty.Empty, error) { var mic lorawan.MIC var gwIDs []lorawan.EUI64 copy(mic[:], req.Mic) for i := range req.GatewayMacs { var id lorawan.EUI64 copy(id[:], req.GatewayMacs[i]) gwIDs = append(gwIDs,...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "SendProprietaryPayload", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "SendProprietaryPayloadRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "var", "mic", "loraw...
// SendProprietaryPayload send a payload using the 'Proprietary' LoRaWAN message-type.
[ "SendProprietaryPayload", "send", "a", "payload", "using", "the", "Proprietary", "LoRaWAN", "message", "-", "type", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L784-L801
163,976
brocaar/loraserver
internal/api/network_server.go
GetGateway
func (n *NetworkServerAPI) GetGateway(ctx context.Context, req *ns.GetGatewayRequest) (*ns.GetGatewayResponse, error) { var id lorawan.EUI64 copy(id[:], req.Id) gw, err := storage.GetGateway(storage.DB(), id) if err != nil { return nil, errToRPCError(err) } resp := ns.GetGatewayResponse{ Gateway: &ns.Gatewa...
go
func (n *NetworkServerAPI) GetGateway(ctx context.Context, req *ns.GetGatewayRequest) (*ns.GetGatewayResponse, error) { var id lorawan.EUI64 copy(id[:], req.Id) gw, err := storage.GetGateway(storage.DB(), id) if err != nil { return nil, errToRPCError(err) } resp := ns.GetGatewayResponse{ Gateway: &ns.Gatewa...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetGateway", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "GetGatewayRequest", ")", "(", "*", "ns", ".", "GetGatewayResponse", ",", "error", ")", "{", "var", "id", "lorawan", ".", "...
// GetGateway returns data for a particular gateway.
[ "GetGateway", "returns", "data", "for", "a", "particular", "gateway", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L863-L912
163,977
brocaar/loraserver
internal/api/network_server.go
DeleteGateway
func (n *NetworkServerAPI) DeleteGateway(ctx context.Context, req *ns.DeleteGatewayRequest) (*empty.Empty, error) { var id lorawan.EUI64 copy(id[:], req.Id) if err := storage.FlushGatewayCache(storage.RedisPool(), id); err != nil { return nil, errToRPCError(err) } if err := storage.DeleteGateway(storage.DB(), ...
go
func (n *NetworkServerAPI) DeleteGateway(ctx context.Context, req *ns.DeleteGatewayRequest) (*empty.Empty, error) { var id lorawan.EUI64 copy(id[:], req.Id) if err := storage.FlushGatewayCache(storage.RedisPool(), id); err != nil { return nil, errToRPCError(err) } if err := storage.DeleteGateway(storage.DB(), ...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "DeleteGateway", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "DeleteGatewayRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "var", "id", "lorawan", ".", "EUI6...
// DeleteGateway deletes a gateway.
[ "DeleteGateway", "deletes", "a", "gateway", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L984-L997
163,978
brocaar/loraserver
internal/api/network_server.go
GetGatewayStats
func (n *NetworkServerAPI) GetGatewayStats(ctx context.Context, req *ns.GetGatewayStatsRequest) (*ns.GetGatewayStatsResponse, error) { gatewayID := helpers.GetGatewayID(req) start, err := ptypes.Timestamp(req.StartTimestamp) if err != nil { return nil, grpc.Errorf(codes.InvalidArgument, err.Error()) } end, err...
go
func (n *NetworkServerAPI) GetGatewayStats(ctx context.Context, req *ns.GetGatewayStatsRequest) (*ns.GetGatewayStatsResponse, error) { gatewayID := helpers.GetGatewayID(req) start, err := ptypes.Timestamp(req.StartTimestamp) if err != nil { return nil, grpc.Errorf(codes.InvalidArgument, err.Error()) } end, err...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetGatewayStats", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "GetGatewayStatsRequest", ")", "(", "*", "ns", ".", "GetGatewayStatsResponse", ",", "error", ")", "{", "gatewayID", ":=", ...
// GetGatewayStats returns stats of an existing gateway.
[ "GetGatewayStats", "returns", "stats", "of", "an", "existing", "gateway", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1000-L1037
163,979
brocaar/loraserver
internal/api/network_server.go
StreamFrameLogsForGateway
func (n *NetworkServerAPI) StreamFrameLogsForGateway(req *ns.StreamFrameLogsForGatewayRequest, srv ns.NetworkServerService_StreamFrameLogsForGatewayServer) error { frameLogChan := make(chan framelog.FrameLog) var id lorawan.EUI64 copy(id[:], req.GatewayId) go func() { err := framelog.GetFrameLogForGateway(srv.Co...
go
func (n *NetworkServerAPI) StreamFrameLogsForGateway(req *ns.StreamFrameLogsForGatewayRequest, srv ns.NetworkServerService_StreamFrameLogsForGatewayServer) error { frameLogChan := make(chan framelog.FrameLog) var id lorawan.EUI64 copy(id[:], req.GatewayId) go func() { err := framelog.GetFrameLogForGateway(srv.Co...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "StreamFrameLogsForGateway", "(", "req", "*", "ns", ".", "StreamFrameLogsForGatewayRequest", ",", "srv", "ns", ".", "NetworkServerService_StreamFrameLogsForGatewayServer", ")", "error", "{", "frameLogChan", ":=", "make", ...
// StreamFrameLogsForGateway returns a stream of frames seen by the given gateway.
[ "StreamFrameLogsForGateway", "returns", "a", "stream", "of", "frames", "seen", "by", "the", "given", "gateway", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1040-L1074
163,980
brocaar/loraserver
internal/api/network_server.go
StreamFrameLogsForDevice
func (n *NetworkServerAPI) StreamFrameLogsForDevice(req *ns.StreamFrameLogsForDeviceRequest, srv ns.NetworkServerService_StreamFrameLogsForDeviceServer) error { frameLogChan := make(chan framelog.FrameLog) var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) go func() { err := framelog.GetFrameLogForDevice(srv.C...
go
func (n *NetworkServerAPI) StreamFrameLogsForDevice(req *ns.StreamFrameLogsForDeviceRequest, srv ns.NetworkServerService_StreamFrameLogsForDeviceServer) error { frameLogChan := make(chan framelog.FrameLog) var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) go func() { err := framelog.GetFrameLogForDevice(srv.C...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "StreamFrameLogsForDevice", "(", "req", "*", "ns", ".", "StreamFrameLogsForDeviceRequest", ",", "srv", "ns", ".", "NetworkServerService_StreamFrameLogsForDeviceServer", ")", "error", "{", "frameLogChan", ":=", "make", "(...
// StreamFrameLogsForDevice returns a stream of frames seen by the given device.
[ "StreamFrameLogsForDevice", "returns", "a", "stream", "of", "frames", "seen", "by", "the", "given", "device", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1077-L1111
163,981
brocaar/loraserver
internal/api/network_server.go
GetGatewayProfile
func (n *NetworkServerAPI) GetGatewayProfile(ctx context.Context, req *ns.GetGatewayProfileRequest) (*ns.GetGatewayProfileResponse, error) { var gpID uuid.UUID copy(gpID[:], req.Id) gc, err := storage.GetGatewayProfile(storage.DB(), gpID) if err != nil { return nil, errToRPCError(err) } out := ns.GetGatewayPr...
go
func (n *NetworkServerAPI) GetGatewayProfile(ctx context.Context, req *ns.GetGatewayProfileRequest) (*ns.GetGatewayProfileResponse, error) { var gpID uuid.UUID copy(gpID[:], req.Id) gc, err := storage.GetGatewayProfile(storage.DB(), gpID) if err != nil { return nil, errToRPCError(err) } out := ns.GetGatewayPr...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetGatewayProfile", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "GetGatewayProfileRequest", ")", "(", "*", "ns", ".", "GetGatewayProfileResponse", ",", "error", ")", "{", "var", "gpID", ...
// GetGatewayProfile returns the gateway-profile given an id.
[ "GetGatewayProfile", "returns", "the", "gateway", "-", "profile", "given", "an", "id", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1162-L1213
163,982
brocaar/loraserver
internal/api/network_server.go
UpdateGatewayProfile
func (n *NetworkServerAPI) UpdateGatewayProfile(ctx context.Context, req *ns.UpdateGatewayProfileRequest) (*empty.Empty, error) { if req.GatewayProfile == nil { return nil, grpc.Errorf(codes.InvalidArgument, "gateway_profile must not be nil") } var gpID uuid.UUID copy(gpID[:], req.GatewayProfile.Id) gc, err :=...
go
func (n *NetworkServerAPI) UpdateGatewayProfile(ctx context.Context, req *ns.UpdateGatewayProfileRequest) (*empty.Empty, error) { if req.GatewayProfile == nil { return nil, grpc.Errorf(codes.InvalidArgument, "gateway_profile must not be nil") } var gpID uuid.UUID copy(gpID[:], req.GatewayProfile.Id) gc, err :=...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "UpdateGatewayProfile", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "UpdateGatewayProfileRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "if", "req", ".", "Gat...
// UpdateGatewayProfile updates the given gateway-profile.
[ "UpdateGatewayProfile", "updates", "the", "given", "gateway", "-", "profile", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1216-L1264
163,983
brocaar/loraserver
internal/api/network_server.go
DeleteGatewayProfile
func (n *NetworkServerAPI) DeleteGatewayProfile(ctx context.Context, req *ns.DeleteGatewayProfileRequest) (*empty.Empty, error) { var gpID uuid.UUID copy(gpID[:], req.Id) if err := storage.DeleteGatewayProfile(storage.DB(), gpID); err != nil { return nil, errToRPCError(err) } return &empty.Empty{}, nil }
go
func (n *NetworkServerAPI) DeleteGatewayProfile(ctx context.Context, req *ns.DeleteGatewayProfileRequest) (*empty.Empty, error) { var gpID uuid.UUID copy(gpID[:], req.Id) if err := storage.DeleteGatewayProfile(storage.DB(), gpID); err != nil { return nil, errToRPCError(err) } return &empty.Empty{}, nil }
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "DeleteGatewayProfile", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "DeleteGatewayProfileRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "var", "gpID", "uuid", ...
// DeleteGatewayProfile deletes the gateway-profile matching a given id.
[ "DeleteGatewayProfile", "deletes", "the", "gateway", "-", "profile", "matching", "a", "given", "id", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1267-L1276
163,984
brocaar/loraserver
internal/api/network_server.go
FlushDeviceQueueForDevEUI
func (n *NetworkServerAPI) FlushDeviceQueueForDevEUI(ctx context.Context, req *ns.FlushDeviceQueueForDevEUIRequest) (*empty.Empty, error) { var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) err := storage.FlushDeviceQueueForDevEUI(storage.DB(), devEUI) if err != nil { return nil, errToRPCError(err) } retur...
go
func (n *NetworkServerAPI) FlushDeviceQueueForDevEUI(ctx context.Context, req *ns.FlushDeviceQueueForDevEUIRequest) (*empty.Empty, error) { var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) err := storage.FlushDeviceQueueForDevEUI(storage.DB(), devEUI) if err != nil { return nil, errToRPCError(err) } retur...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "FlushDeviceQueueForDevEUI", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "FlushDeviceQueueForDevEUIRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "var", "devEUI",...
// FlushDeviceQueueForDevEUI flushes the device-queue for the given DevEUI.
[ "FlushDeviceQueueForDevEUI", "flushes", "the", "device", "-", "queue", "for", "the", "given", "DevEUI", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1360-L1370
163,985
brocaar/loraserver
internal/api/network_server.go
GetDeviceQueueItemsForDevEUI
func (n *NetworkServerAPI) GetDeviceQueueItemsForDevEUI(ctx context.Context, req *ns.GetDeviceQueueItemsForDevEUIRequest) (*ns.GetDeviceQueueItemsForDevEUIResponse, error) { var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) items, err := storage.GetDeviceQueueItemsForDevEUI(storage.DB(), devEUI) if err != nil {...
go
func (n *NetworkServerAPI) GetDeviceQueueItemsForDevEUI(ctx context.Context, req *ns.GetDeviceQueueItemsForDevEUIRequest) (*ns.GetDeviceQueueItemsForDevEUIResponse, error) { var devEUI lorawan.EUI64 copy(devEUI[:], req.DevEui) items, err := storage.GetDeviceQueueItemsForDevEUI(storage.DB(), devEUI) if err != nil {...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetDeviceQueueItemsForDevEUI", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "GetDeviceQueueItemsForDevEUIRequest", ")", "(", "*", "ns", ".", "GetDeviceQueueItemsForDevEUIResponse", ",", "error", ...
// GetDeviceQueueItemsForDevEUI returns all device-queue items for the given DevEUI.
[ "GetDeviceQueueItemsForDevEUI", "returns", "all", "device", "-", "queue", "items", "for", "the", "given", "DevEUI", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1373-L1397
163,986
brocaar/loraserver
internal/api/network_server.go
GetNextDownlinkFCntForDevEUI
func (n *NetworkServerAPI) GetNextDownlinkFCntForDevEUI(ctx context.Context, req *ns.GetNextDownlinkFCntForDevEUIRequest) (*ns.GetNextDownlinkFCntForDevEUIResponse, error) { var devEUI lorawan.EUI64 var resp ns.GetNextDownlinkFCntForDevEUIResponse copy(devEUI[:], req.DevEui) ds, err := storage.GetDeviceSession(st...
go
func (n *NetworkServerAPI) GetNextDownlinkFCntForDevEUI(ctx context.Context, req *ns.GetNextDownlinkFCntForDevEUIRequest) (*ns.GetNextDownlinkFCntForDevEUIResponse, error) { var devEUI lorawan.EUI64 var resp ns.GetNextDownlinkFCntForDevEUIResponse copy(devEUI[:], req.DevEui) ds, err := storage.GetDeviceSession(st...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetNextDownlinkFCntForDevEUI", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "GetNextDownlinkFCntForDevEUIRequest", ")", "(", "*", "ns", ".", "GetNextDownlinkFCntForDevEUIResponse", ",", "error", ...
// GetNextDownlinkFCntForDevEUI returns the next FCnt that must be used. // This also takes device-queue items for the given DevEUI into consideration. // In case the device is not activated, this will return an error as no // device-session exists.
[ "GetNextDownlinkFCntForDevEUI", "returns", "the", "next", "FCnt", "that", "must", "be", "used", ".", "This", "also", "takes", "device", "-", "queue", "items", "for", "the", "given", "DevEUI", "into", "consideration", ".", "In", "case", "the", "device", "is", ...
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1403-L1429
163,987
brocaar/loraserver
internal/api/network_server.go
CreateMulticastGroup
func (n *NetworkServerAPI) CreateMulticastGroup(ctx context.Context, req *ns.CreateMulticastGroupRequest) (*ns.CreateMulticastGroupResponse, error) { if req.MulticastGroup == nil { return nil, grpc.Errorf(codes.InvalidArgument, "multicast_group must not be nil") } mg := storage.MulticastGroup{ FCnt: r...
go
func (n *NetworkServerAPI) CreateMulticastGroup(ctx context.Context, req *ns.CreateMulticastGroupRequest) (*ns.CreateMulticastGroupResponse, error) { if req.MulticastGroup == nil { return nil, grpc.Errorf(codes.InvalidArgument, "multicast_group must not be nil") } mg := storage.MulticastGroup{ FCnt: r...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "CreateMulticastGroup", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "CreateMulticastGroupRequest", ")", "(", "*", "ns", ".", "CreateMulticastGroupResponse", ",", "error", ")", "{", "if", ...
// CreateMulticastGroup creates the given multicast-group.
[ "CreateMulticastGroup", "creates", "the", "given", "multicast", "-", "group", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1432-L1466
163,988
brocaar/loraserver
internal/api/network_server.go
GetMulticastGroup
func (n *NetworkServerAPI) GetMulticastGroup(ctx context.Context, req *ns.GetMulticastGroupRequest) (*ns.GetMulticastGroupResponse, error) { var mgID uuid.UUID copy(mgID[:], req.Id) mg, err := storage.GetMulticastGroup(storage.DB(), mgID, false) if err != nil { return nil, errToRPCError(err) } resp := ns.GetM...
go
func (n *NetworkServerAPI) GetMulticastGroup(ctx context.Context, req *ns.GetMulticastGroupRequest) (*ns.GetMulticastGroupResponse, error) { var mgID uuid.UUID copy(mgID[:], req.Id) mg, err := storage.GetMulticastGroup(storage.DB(), mgID, false) if err != nil { return nil, errToRPCError(err) } resp := ns.GetM...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetMulticastGroup", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "GetMulticastGroupRequest", ")", "(", "*", "ns", ".", "GetMulticastGroupResponse", ",", "error", ")", "{", "var", "mgID", ...
// GetMulticastGroup returns the multicast-group given an id.
[ "GetMulticastGroup", "returns", "the", "multicast", "-", "group", "given", "an", "id", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1469-L1512
163,989
brocaar/loraserver
internal/api/network_server.go
UpdateMulticastGroup
func (n *NetworkServerAPI) UpdateMulticastGroup(ctx context.Context, req *ns.UpdateMulticastGroupRequest) (*empty.Empty, error) { if req.MulticastGroup == nil { return nil, grpc.Errorf(codes.InvalidArgument, "multicast_group must not be nil") } var mgID uuid.UUID copy(mgID[:], req.MulticastGroup.Id) err := sto...
go
func (n *NetworkServerAPI) UpdateMulticastGroup(ctx context.Context, req *ns.UpdateMulticastGroupRequest) (*empty.Empty, error) { if req.MulticastGroup == nil { return nil, grpc.Errorf(codes.InvalidArgument, "multicast_group must not be nil") } var mgID uuid.UUID copy(mgID[:], req.MulticastGroup.Id) err := sto...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "UpdateMulticastGroup", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "UpdateMulticastGroupRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "if", "req", ".", "Mul...
// UpdateMulticastGroup updates the given multicast-group.
[ "UpdateMulticastGroup", "updates", "the", "given", "multicast", "-", "group", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1515-L1558
163,990
brocaar/loraserver
internal/api/network_server.go
DeleteMulticastGroup
func (n *NetworkServerAPI) DeleteMulticastGroup(ctx context.Context, req *ns.DeleteMulticastGroupRequest) (*empty.Empty, error) { var mgID uuid.UUID copy(mgID[:], req.Id) if err := storage.DeleteMulticastGroup(storage.DB(), mgID); err != nil { return nil, errToRPCError(err) } return &empty.Empty{}, nil }
go
func (n *NetworkServerAPI) DeleteMulticastGroup(ctx context.Context, req *ns.DeleteMulticastGroupRequest) (*empty.Empty, error) { var mgID uuid.UUID copy(mgID[:], req.Id) if err := storage.DeleteMulticastGroup(storage.DB(), mgID); err != nil { return nil, errToRPCError(err) } return &empty.Empty{}, nil }
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "DeleteMulticastGroup", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "DeleteMulticastGroupRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "var", "mgID", "uuid", ...
// DeleteMulticastGroup deletes a multicast-group given an id.
[ "DeleteMulticastGroup", "deletes", "a", "multicast", "-", "group", "given", "an", "id", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1561-L1570
163,991
brocaar/loraserver
internal/api/network_server.go
EnqueueMulticastQueueItem
func (n *NetworkServerAPI) EnqueueMulticastQueueItem(ctx context.Context, req *ns.EnqueueMulticastQueueItemRequest) (*empty.Empty, error) { if req.MulticastQueueItem == nil { return nil, grpc.Errorf(codes.InvalidArgument, "multicast_queue_item must not be nil") } var mgID uuid.UUID copy(mgID[:], req.MulticastQue...
go
func (n *NetworkServerAPI) EnqueueMulticastQueueItem(ctx context.Context, req *ns.EnqueueMulticastQueueItemRequest) (*empty.Empty, error) { if req.MulticastQueueItem == nil { return nil, grpc.Errorf(codes.InvalidArgument, "multicast_queue_item must not be nil") } var mgID uuid.UUID copy(mgID[:], req.MulticastQue...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "EnqueueMulticastQueueItem", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "EnqueueMulticastQueueItemRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{", "if", "req", "...
// EnqueueMulticastQueueItem creates the given multicast queue-item.
[ "EnqueueMulticastQueueItem", "creates", "the", "given", "multicast", "queue", "-", "item", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1601-L1624
163,992
brocaar/loraserver
internal/api/network_server.go
FlushMulticastQueueForMulticastGroup
func (n *NetworkServerAPI) FlushMulticastQueueForMulticastGroup(ctx context.Context, req *ns.FlushMulticastQueueForMulticastGroupRequest) (*empty.Empty, error) { var mgID uuid.UUID copy(mgID[:], req.MulticastGroupId) if err := storage.FlushMulticastQueueForMulticastGroup(storage.DB(), mgID); err != nil { return n...
go
func (n *NetworkServerAPI) FlushMulticastQueueForMulticastGroup(ctx context.Context, req *ns.FlushMulticastQueueForMulticastGroupRequest) (*empty.Empty, error) { var mgID uuid.UUID copy(mgID[:], req.MulticastGroupId) if err := storage.FlushMulticastQueueForMulticastGroup(storage.DB(), mgID); err != nil { return n...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "FlushMulticastQueueForMulticastGroup", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "FlushMulticastQueueForMulticastGroupRequest", ")", "(", "*", "empty", ".", "Empty", ",", "error", ")", "{"...
// FlushMulticastQueueForMulticastGroup flushes the multicast device-queue given a multicast-group id.
[ "FlushMulticastQueueForMulticastGroup", "flushes", "the", "multicast", "device", "-", "queue", "given", "a", "multicast", "-", "group", "id", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1627-L1636
163,993
brocaar/loraserver
internal/api/network_server.go
GetMulticastQueueItemsForMulticastGroup
func (n *NetworkServerAPI) GetMulticastQueueItemsForMulticastGroup(ctx context.Context, req *ns.GetMulticastQueueItemsForMulticastGroupRequest) (*ns.GetMulticastQueueItemsForMulticastGroupResponse, error) { var mgID uuid.UUID copy(mgID[:], req.MulticastGroupId) items, err := storage.GetMulticastQueueItemsForMultica...
go
func (n *NetworkServerAPI) GetMulticastQueueItemsForMulticastGroup(ctx context.Context, req *ns.GetMulticastQueueItemsForMulticastGroupRequest) (*ns.GetMulticastQueueItemsForMulticastGroupResponse, error) { var mgID uuid.UUID copy(mgID[:], req.MulticastGroupId) items, err := storage.GetMulticastQueueItemsForMultica...
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetMulticastQueueItemsForMulticastGroup", "(", "ctx", "context", ".", "Context", ",", "req", "*", "ns", ".", "GetMulticastQueueItemsForMulticastGroupRequest", ")", "(", "*", "ns", ".", "GetMulticastQueueItemsForMulticastG...
// GetMulticastQueueItemsForMulticastGroup returns the queue-items given a multicast-group id.
[ "GetMulticastQueueItemsForMulticastGroup", "returns", "the", "queue", "-", "items", "given", "a", "multicast", "-", "group", "id", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1639-L1667
163,994
brocaar/loraserver
internal/api/network_server.go
GetVersion
func (n *NetworkServerAPI) GetVersion(ctx context.Context, req *empty.Empty) (*ns.GetVersionResponse, error) { region, ok := map[string]common.Region{ common.Region_AS923.String(): common.Region_AS923, common.Region_AU915.String(): common.Region_AU915, common.Region_CN470.String(): common.Region_CN470, common....
go
func (n *NetworkServerAPI) GetVersion(ctx context.Context, req *empty.Empty) (*ns.GetVersionResponse, error) { region, ok := map[string]common.Region{ common.Region_AS923.String(): common.Region_AS923, common.Region_AU915.String(): common.Region_AU915, common.Region_CN470.String(): common.Region_CN470, common....
[ "func", "(", "n", "*", "NetworkServerAPI", ")", "GetVersion", "(", "ctx", "context", ".", "Context", ",", "req", "*", "empty", ".", "Empty", ")", "(", "*", "ns", ".", "GetVersionResponse", ",", "error", ")", "{", "region", ",", "ok", ":=", "map", "["...
// GetVersion returns the LoRa Server version.
[ "GetVersion", "returns", "the", "LoRa", "Server", "version", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/api/network_server.go#L1670-L1694
163,995
brocaar/loraserver
internal/framelog/helpers.go
CreateUplinkFrameSet
func CreateUplinkFrameSet(rxPacket models.RXPacket) (gw.UplinkFrameSet, error) { b, err := rxPacket.PHYPayload.MarshalBinary() if err != nil { return gw.UplinkFrameSet{}, errors.Wrap(err, "marshal phypayload error") } return gw.UplinkFrameSet{ PhyPayload: b, TxInfo: rxPacket.TXInfo, RxInfo: rxPacke...
go
func CreateUplinkFrameSet(rxPacket models.RXPacket) (gw.UplinkFrameSet, error) { b, err := rxPacket.PHYPayload.MarshalBinary() if err != nil { return gw.UplinkFrameSet{}, errors.Wrap(err, "marshal phypayload error") } return gw.UplinkFrameSet{ PhyPayload: b, TxInfo: rxPacket.TXInfo, RxInfo: rxPacke...
[ "func", "CreateUplinkFrameSet", "(", "rxPacket", "models", ".", "RXPacket", ")", "(", "gw", ".", "UplinkFrameSet", ",", "error", ")", "{", "b", ",", "err", ":=", "rxPacket", ".", "PHYPayload", ".", "MarshalBinary", "(", ")", "\n", "if", "err", "!=", "nil...
// CreateUplinkFrameSet creates a UplinkFrameSet.
[ "CreateUplinkFrameSet", "creates", "a", "UplinkFrameSet", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/framelog/helpers.go#L11-L22
163,996
brocaar/loraserver
internal/backend/joinserver/pool.go
Get
func (p *pool) Get(joinEUI lorawan.EUI64) (Client, error) { if !p.resolveJoinEUI { return p.defaultClient, nil } p.RLock() pc, ok := p.clients[joinEUI] p.RUnlock() if ok { return pc.client, nil } client, err := p.resolveJoinServer(joinEUI) if err != nil { log.WithField("join_eui", joinEUI).WithError(er...
go
func (p *pool) Get(joinEUI lorawan.EUI64) (Client, error) { if !p.resolveJoinEUI { return p.defaultClient, nil } p.RLock() pc, ok := p.clients[joinEUI] p.RUnlock() if ok { return pc.client, nil } client, err := p.resolveJoinServer(joinEUI) if err != nil { log.WithField("join_eui", joinEUI).WithError(er...
[ "func", "(", "p", "*", "pool", ")", "Get", "(", "joinEUI", "lorawan", ".", "EUI64", ")", "(", "Client", ",", "error", ")", "{", "if", "!", "p", ".", "resolveJoinEUI", "{", "return", "p", ".", "defaultClient", ",", "nil", "\n", "}", "\n\n", "p", "...
// Get returns the join-server client for the given joinEUI.
[ "Get", "returns", "the", "join", "-", "server", "client", "for", "the", "given", "joinEUI", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/backend/joinserver/pool.go#L41-L64
163,997
brocaar/loraserver
cmd/loraserver/cmd/mqtt2to3.go
NewMQTT2To3Backend
func NewMQTT2To3Backend(conf config.Config) (*MQTT2To3Backend, error) { c := conf.NetworkServer.Gateway.Backend.MQTT b := MQTT2To3Backend{} opts := mqtt.NewClientOptions() opts.AddBroker(c.Server) opts.SetUsername(c.Username) opts.SetPassword(c.Password) opts.SetCleanSession(c.CleanSession) opts.SetClientID(c...
go
func NewMQTT2To3Backend(conf config.Config) (*MQTT2To3Backend, error) { c := conf.NetworkServer.Gateway.Backend.MQTT b := MQTT2To3Backend{} opts := mqtt.NewClientOptions() opts.AddBroker(c.Server) opts.SetUsername(c.Username) opts.SetPassword(c.Password) opts.SetCleanSession(c.CleanSession) opts.SetClientID(c...
[ "func", "NewMQTT2To3Backend", "(", "conf", "config", ".", "Config", ")", "(", "*", "MQTT2To3Backend", ",", "error", ")", "{", "c", ":=", "conf", ".", "NetworkServer", ".", "Gateway", ".", "Backend", ".", "MQTT", "\n\n", "b", ":=", "MQTT2To3Backend", "{", ...
// NewMQTT2To3Backend creates a new Backend.
[ "NewMQTT2To3Backend", "creates", "a", "new", "Backend", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/cmd/loraserver/cmd/mqtt2to3.go#L43-L81
163,998
brocaar/loraserver
internal/storage/downlink_frames.go
SaveDownlinkFrames
func SaveDownlinkFrames(p *redis.Pool, devEUI lorawan.EUI64, frames []gw.DownlinkFrame) error { if len(frames) == 0 { return nil } var token uint32 var frameBytes [][]byte for _, frame := range frames { token = frame.Token b, err := proto.Marshal(&frame) if err != nil { return errors.Wrap(err, "marshal...
go
func SaveDownlinkFrames(p *redis.Pool, devEUI lorawan.EUI64, frames []gw.DownlinkFrame) error { if len(frames) == 0 { return nil } var token uint32 var frameBytes [][]byte for _, frame := range frames { token = frame.Token b, err := proto.Marshal(&frame) if err != nil { return errors.Wrap(err, "marshal...
[ "func", "SaveDownlinkFrames", "(", "p", "*", "redis", ".", "Pool", ",", "devEUI", "lorawan", ".", "EUI64", ",", "frames", "[", "]", "gw", ".", "DownlinkFrame", ")", "error", "{", "if", "len", "(", "frames", ")", "==", "0", "{", "return", "nil", "\n",...
// SaveDownlinkFrames saves the given downlink-frames. The downlink-frames // must share the same token!
[ "SaveDownlinkFrames", "saves", "the", "given", "downlink", "-", "frames", ".", "The", "downlink", "-", "frames", "must", "share", "the", "same", "token!" ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/storage/downlink_frames.go#L22-L66
163,999
brocaar/loraserver
internal/storage/downlink_frames.go
PopDownlinkFrame
func PopDownlinkFrame(p *redis.Pool, token uint32) (lorawan.EUI64, gw.DownlinkFrame, error) { var out gw.DownlinkFrame var devEUI lorawan.EUI64 c := p.Get() defer c.Close() b, err := redis.Bytes(c.Do("LPOP", fmt.Sprintf(downlinkFramesKeyTempl, token))) if err != nil { if err == redis.ErrNil { return lorawa...
go
func PopDownlinkFrame(p *redis.Pool, token uint32) (lorawan.EUI64, gw.DownlinkFrame, error) { var out gw.DownlinkFrame var devEUI lorawan.EUI64 c := p.Get() defer c.Close() b, err := redis.Bytes(c.Do("LPOP", fmt.Sprintf(downlinkFramesKeyTempl, token))) if err != nil { if err == redis.ErrNil { return lorawa...
[ "func", "PopDownlinkFrame", "(", "p", "*", "redis", ".", "Pool", ",", "token", "uint32", ")", "(", "lorawan", ".", "EUI64", ",", "gw", ".", "DownlinkFrame", ",", "error", ")", "{", "var", "out", "gw", ".", "DownlinkFrame", "\n", "var", "devEUI", "loraw...
// PopDownlinkFrame returns the first downlink-frame for the given token.
[ "PopDownlinkFrame", "returns", "the", "first", "downlink", "-", "frame", "for", "the", "given", "token", "." ]
33ed6586ede637a540864142fcda0b7e3b90203d
https://github.com/brocaar/loraserver/blob/33ed6586ede637a540864142fcda0b7e3b90203d/internal/storage/downlink_frames.go#L69-L99