func New(s ShowType) *ColorConsole { c := &ColorConsole{ ty: s, } c.BaseListener = listener.NewBaseListener(c) return c }
func New(name string) (*File, error) { f := &File{ name: name, } var err error f.f, err = os.Create(name) if err != nil { return nil, err } f.BaseListener = listener.NewBaseListener(f) return f, nil }
func New(host string) (*Udp, error) { addr, err := net.ResolveUDPAddr("udp4", host) if err != nil { return nil, err } udp, err := net.DialUDP("udp4", nil, addr) if err != nil { return nil, err } u := &Udp{ host: host, udp: udp, } u.BaseListener = listener.NewBaseListener(u) return u, nil }
func New() *Console { c := &Console{} c.BaseListener = listener.NewBaseListener(c) return c }