forked from swift-server/swift-memcache-gsoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMemcachedRequest.swift
41 lines (36 loc) · 1.03 KB
/
MemcachedRequest.swift
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
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-memcache-gsoc open source project
//
// Copyright (c) 2023 Apple Inc. and the swift-memcache-gsoc project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of swift-memcache-gsoc project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
enum MemcachedRequest {
struct SetCommand {
let key: String
var value: ByteBuffer
var flags: MemcachedFlags?
}
struct GetCommand {
let key: String
var flags: MemcachedFlags
}
struct DeleteCommand {
let key: String
}
struct ArithmeticCommand {
let key: String
var flags: MemcachedFlags
}
case set(SetCommand)
case get(GetCommand)
case delete(DeleteCommand)
case arithmetic(ArithmeticCommand)
}