Documentation ¶
Overview ¶
*
Taken and repurposed from https://github.com/nsf/termbox-go/tree/master/_demos/editbox.go author: termbox-go authors & nan0 authors
Index ¶
- Variables
- func KeysToNan0Bytes(encKeyShare, authKeyShare string) (encKey, authKey *[32]byte)
- func Serve(port int) (err error)
- type ChatClient
- type ChatClientUI
- type ChatMessage
- func (*ChatMessage) Descriptor() ([]byte, []int)
- func (m *ChatMessage) GetMessage() string
- func (m *ChatMessage) GetMessageId() int64
- func (m *ChatMessage) GetTime() int64
- func (m *ChatMessage) GetUserId() int64
- func (*ChatMessage) ProtoMessage()
- func (m *ChatMessage) Reset()
- func (m *ChatMessage) String() string
- func (m *ChatMessage) XXX_DiscardUnknown()
- func (m *ChatMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ChatMessage) XXX_Merge(src proto.Message)
- func (m *ChatMessage) XXX_Size() int
- func (m *ChatMessage) XXX_Unmarshal(b []byte) error
- type ChatServer
- type ConnectedUser
- type EditBox
- func (eb *EditBox) AdjustVOffset(width int)
- func (eb *EditBox) Clear()
- func (eb *EditBox) CursorX() int
- func (eb *EditBox) DeleteRuneBackward()
- func (eb *EditBox) DeleteRuneForward()
- func (eb *EditBox) DeleteTheRestOfTheLine()
- func (eb *EditBox) Draw(x, y, w, h int)
- func (eb *EditBox) InsertRune(r rune)
- func (eb *EditBox) MoveCursorOneRuneBackward()
- func (eb *EditBox) MoveCursorOneRuneForward()
- func (eb *EditBox) MoveCursorTo(boffset int)
- func (eb *EditBox) MoveCursorToBeginningOfTheLine()
- func (eb *EditBox) MoveCursorToEndOfTheLine()
- func (eb *EditBox) RuneBeforeCursor() (rune, int)
- func (eb *EditBox) RuneUnderCursor() (rune, int)
- type OutputBox
- type User
- func (*User) Descriptor() ([]byte, []int)
- func (m *User) GetUserId() int64
- func (m *User) GetUserName() string
- func (*User) ProtoMessage()
- func (m *User) Reset()
- func (user *User) SetUserId(id int64)
- func (user *User) SetUserName(name string)
- func (m *User) String() string
- func (m *User) XXX_DiscardUnknown()
- func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *User) XXX_Merge(src proto.Message)
- func (m *User) XXX_Size() int
- func (m *User) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var CustomUsername = flag.String("username", "", "A custom user name")
View Source
var EncryptKey = flag.String("key", "", "(Required) Encryption Key encoded in Base64")
application parameter flags definitions
View Source
var Host = flag.String("host", "localhost", "Host name for server")
View Source
var IsServer = flag.Bool("server", false, "Is this a server?")
View Source
var Port = flag.Int("port", 6865, "Port number for server (if --server is [true])")
View Source
var Signature = flag.String("sig", "", "(Required) HMAC Signature encoded in Base64")
Functions ¶
func KeysToNan0Bytes ¶
The nan0 functions require a specific key type and width, this is a way to make that conversion from strings to the required type.
Types ¶
type ChatClient ¶
type ChatClient struct {
// contains filtered or unexported fields
}
func NewChatClient ¶
func NewChatClient() (client *ChatClient)
func (*ChatClient) Connect ¶
func (client *ChatClient) Connect()
Connects to the target service (defined in the application flags)
type ChatClientUI ¶
type ChatClientUI struct {
// contains filtered or unexported fields
}
func (*ChatClientUI) Start ¶
func (chatUi *ChatClientUI) Start(prefix string, messageChannel chan<- string)
type ChatMessage ¶
type ChatMessage struct { UserId int64 `protobuf:"varint,3,opt,name=userId,proto3" json:"userId,omitempty"` MessageId int64 `protobuf:"varint,4,opt,name=messageId,proto3" json:"messageId,omitempty"` Time int64 `protobuf:"varint,5,opt,name=time,proto3" json:"time,omitempty"` Message string `protobuf:"bytes,6,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ChatMessage) Descriptor ¶
func (*ChatMessage) Descriptor() ([]byte, []int)
func (*ChatMessage) GetMessage ¶
func (m *ChatMessage) GetMessage() string
func (*ChatMessage) GetMessageId ¶
func (m *ChatMessage) GetMessageId() int64
func (*ChatMessage) GetTime ¶
func (m *ChatMessage) GetTime() int64
func (*ChatMessage) GetUserId ¶
func (m *ChatMessage) GetUserId() int64
func (*ChatMessage) ProtoMessage ¶
func (*ChatMessage) ProtoMessage()
func (*ChatMessage) Reset ¶
func (m *ChatMessage) Reset()
func (*ChatMessage) String ¶
func (m *ChatMessage) String() string
func (*ChatMessage) XXX_DiscardUnknown ¶
func (m *ChatMessage) XXX_DiscardUnknown()
func (*ChatMessage) XXX_Marshal ¶
func (m *ChatMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ChatMessage) XXX_Merge ¶
func (dst *ChatMessage) XXX_Merge(src proto.Message)
func (*ChatMessage) XXX_Size ¶
func (m *ChatMessage) XXX_Size() int
func (*ChatMessage) XXX_Unmarshal ¶
func (m *ChatMessage) XXX_Unmarshal(b []byte) error
type ChatServer ¶
type ChatServer struct {
// contains filtered or unexported fields
}
type ConnectedUser ¶
type ConnectedUser struct {
// contains filtered or unexported fields
}
type EditBox ¶
type EditBox struct {
// contains filtered or unexported fields
}
func (*EditBox) AdjustVOffset ¶
Adjusts line visual offset to a proper value depending on width
func (*EditBox) CursorX ¶
Please, keep in mind that cursor depends on the value of line_voffset, which is being set on Draw() call, so.. call this method after Draw() one.
func (*EditBox) DeleteRuneBackward ¶
func (eb *EditBox) DeleteRuneBackward()
func (*EditBox) DeleteRuneForward ¶
func (eb *EditBox) DeleteRuneForward()
func (*EditBox) DeleteTheRestOfTheLine ¶
func (eb *EditBox) DeleteTheRestOfTheLine()
func (*EditBox) InsertRune ¶
func (*EditBox) MoveCursorOneRuneBackward ¶
func (eb *EditBox) MoveCursorOneRuneBackward()
func (*EditBox) MoveCursorOneRuneForward ¶
func (eb *EditBox) MoveCursorOneRuneForward()
func (*EditBox) MoveCursorTo ¶
func (*EditBox) MoveCursorToBeginningOfTheLine ¶
func (eb *EditBox) MoveCursorToBeginningOfTheLine()
func (*EditBox) MoveCursorToEndOfTheLine ¶
func (eb *EditBox) MoveCursorToEndOfTheLine()
func (*EditBox) RuneBeforeCursor ¶
func (*EditBox) RuneUnderCursor ¶
type User ¶
type User struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` UserName string `protobuf:"bytes,2,opt,name=userName,proto3" json:"userName,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*User) Descriptor ¶
func (*User) GetUserName ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) SetUserName ¶
func (*User) XXX_DiscardUnknown ¶
func (m *User) XXX_DiscardUnknown()
func (*User) XXX_Unmarshal ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.