-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.ts
55 lines (43 loc) · 1.77 KB
/
mod.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
This file is part of Deno-ZMTP, an implementation of ZMTP for Deno.
Copyright (C) 2019 Contributors as noted in the AUTHORS.md file
Deno-ZMTP is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
As a reminder, the Contributors give you permission to dynamically
link this library from an executable, regardless of the license terms
of the executable, and to copy and distribute the executable under
terms of your choice.
Deno-ZMTP is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser
General Public License along with Deno-ZMTP. If not, see
<https://www.gnu.org/licenses/>.
*/
import Zmtp_ from "./lib/Zmtp.ts";
import Null_ from "./lib/Zmtp/Null.ts";
import Zerializable_ from "./lib/Zmtp/Zerializable.ts";
import Command_ from "./lib/Zmtp/Command.ts";
import Frame_ from "./lib/Zmtp/Frame.ts";
import * as Detail from "./lib/Zmtp/detail.ts";
type Zmtp = Zmtp_;
namespace Zmtp {
export const MAJOR = Detail.MAJOR;
export const MINOR = Detail.MINOR;
export type Zerializable = Zerializable_;
export const Command = Command_;
export const Frame = Frame_;
export const Null = Null_;
export async function build<Kind extends Zmtp>(
ZmtpKind: new (sock: Deno.Conn) => Kind,
sock: Deno.Conn
) {
const k: Kind = new ZmtpKind(sock);
await k.greet();
await k.handshake();
}
}
export default Zmtp;