-
Notifications
You must be signed in to change notification settings - Fork 48
/
domain.go
87 lines (77 loc) · 3 KB
/
domain.go
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Code generated by cdpgen. DO NOT EDIT.
// Package cachestorage implements the CacheStorage domain.
package cachestorage
import (
"context"
"github.com/mafredri/cdp/protocol/internal"
"github.com/mafredri/cdp/rpcc"
)
// domainClient is a client for the CacheStorage domain.
type domainClient struct{ conn *rpcc.Conn }
// NewClient returns a client for the CacheStorage domain with the connection set to conn.
func NewClient(conn *rpcc.Conn) *domainClient {
return &domainClient{conn: conn}
}
// DeleteCache invokes the CacheStorage method. Deletes a cache.
func (d *domainClient) DeleteCache(ctx context.Context, args *DeleteCacheArgs) (err error) {
if args != nil {
err = rpcc.Invoke(ctx, "CacheStorage.deleteCache", args, nil, d.conn)
} else {
err = rpcc.Invoke(ctx, "CacheStorage.deleteCache", nil, nil, d.conn)
}
if err != nil {
err = &internal.OpError{Domain: "CacheStorage", Op: "DeleteCache", Err: err}
}
return
}
// DeleteEntry invokes the CacheStorage method. Deletes a cache entry.
func (d *domainClient) DeleteEntry(ctx context.Context, args *DeleteEntryArgs) (err error) {
if args != nil {
err = rpcc.Invoke(ctx, "CacheStorage.deleteEntry", args, nil, d.conn)
} else {
err = rpcc.Invoke(ctx, "CacheStorage.deleteEntry", nil, nil, d.conn)
}
if err != nil {
err = &internal.OpError{Domain: "CacheStorage", Op: "DeleteEntry", Err: err}
}
return
}
// RequestCacheNames invokes the CacheStorage method. Requests cache names.
func (d *domainClient) RequestCacheNames(ctx context.Context, args *RequestCacheNamesArgs) (reply *RequestCacheNamesReply, err error) {
reply = new(RequestCacheNamesReply)
if args != nil {
err = rpcc.Invoke(ctx, "CacheStorage.requestCacheNames", args, reply, d.conn)
} else {
err = rpcc.Invoke(ctx, "CacheStorage.requestCacheNames", nil, reply, d.conn)
}
if err != nil {
err = &internal.OpError{Domain: "CacheStorage", Op: "RequestCacheNames", Err: err}
}
return
}
// RequestCachedResponse invokes the CacheStorage method. Fetches cache entry.
func (d *domainClient) RequestCachedResponse(ctx context.Context, args *RequestCachedResponseArgs) (reply *RequestCachedResponseReply, err error) {
reply = new(RequestCachedResponseReply)
if args != nil {
err = rpcc.Invoke(ctx, "CacheStorage.requestCachedResponse", args, reply, d.conn)
} else {
err = rpcc.Invoke(ctx, "CacheStorage.requestCachedResponse", nil, reply, d.conn)
}
if err != nil {
err = &internal.OpError{Domain: "CacheStorage", Op: "RequestCachedResponse", Err: err}
}
return
}
// RequestEntries invokes the CacheStorage method. Requests data from cache.
func (d *domainClient) RequestEntries(ctx context.Context, args *RequestEntriesArgs) (reply *RequestEntriesReply, err error) {
reply = new(RequestEntriesReply)
if args != nil {
err = rpcc.Invoke(ctx, "CacheStorage.requestEntries", args, reply, d.conn)
} else {
err = rpcc.Invoke(ctx, "CacheStorage.requestEntries", nil, reply, d.conn)
}
if err != nil {
err = &internal.OpError{Domain: "CacheStorage", Op: "RequestEntries", Err: err}
}
return
}