Skip to content

Commit

Permalink
Fixes linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Kolevska <[email protected]>
  • Loading branch information
elena-kolevska committed Dec 3, 2023
1 parent aece619 commit 2a7fa82
Show file tree
Hide file tree
Showing 9 changed files with 266 additions and 217 deletions.
21 changes: 10 additions & 11 deletions src/implementation/Client/DaprClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,18 @@ export default class DaprClient {
this.workflow = new HTTPClientWorkflow(client);
break;
}

}

this.options = {
daprHost: options.daprHost,
daprPort: options.daprPort,
communicationProtocol: options.communicationProtocol ?? Settings.getDefaultCommunicationProtocol(),
isKeepAlive: options.isKeepAlive,
logger: options.logger,
actor: options.actor,
daprApiToken: options.daprApiToken,
maxBodySizeMb: options.maxBodySizeMb,
};
this.options = {
daprHost: options.daprHost,
daprPort: options.daprPort,
communicationProtocol: options.communicationProtocol ?? Settings.getDefaultCommunicationProtocol(),
isKeepAlive: options.isKeepAlive,
logger: options.logger,
actor: options.actor,
daprApiToken: options.daprApiToken,
maxBodySizeMb: options.maxBodySizeMb,
};
}

static create(client: IClient): DaprClient {
Expand Down
2 changes: 1 addition & 1 deletion src/implementation/Client/GRPCClient/GRPCClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import GRPCClientSidecar from "./sidecar";
import DaprClient from "../DaprClient";
import { SDK_VERSION } from "../../../version";
import communicationProtocolEnum from "../../../enum/CommunicationProtocol.enum";
import {GrpcEndpoint} from "../../../network/GrpcEndpoint";
import { GrpcEndpoint } from "../../../network/GrpcEndpoint";

export default class GRPCClient implements IClient {
readonly options: DaprClientOptions;
Expand Down
2 changes: 1 addition & 1 deletion src/implementation/Client/HTTPClient/HTTPClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import HTTPClientSidecar from "./sidecar";
import { SDK_VERSION } from "../../../version";
import * as SerializerUtil from "../../../utils/Serializer.util";
import communicationProtocolEnum from "../../../enum/CommunicationProtocol.enum";
import {HttpEndpoint} from "../../../network/HttpEndpoint";
import { HttpEndpoint } from "../../../network/HttpEndpoint";

export default class HTTPClient implements IClient {
readonly options: DaprClientOptions;
Expand Down
81 changes: 47 additions & 34 deletions src/network/AbstractEndpoint.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
import {URL} from "url";
/*
Copyright 2023 The Dapr Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import { URL } from "url";

export abstract class Endpoint {
protected _scheme = "";
protected _hostname = "";
protected _port = 0;
protected _tls = false;
protected _authority = "";
protected _url: string;
protected _endpoint = "";
protected _parsedUrl!: URL;

protected constructor(url: string) {
this._url = url;
}

get tls(): boolean {
return this._tls;
}

get hostname(): string {
return this._hostname;
}

get scheme(): string {
return this._scheme;
}

get port(): string {
return this._port === 0 ? "" : this._port.toString();
}

get endpoint(): string {
return this._endpoint;
}
}
protected _scheme = "";
protected _hostname = "";
protected _port = 0;
protected _tls = false;
protected _authority = "";
protected _url: string;
protected _endpoint = "";
protected _parsedUrl!: URL;

protected constructor(url: string) {
this._url = url;
}

get tls(): boolean {
return this._tls;
}

get hostname(): string {
return this._hostname;
}

get scheme(): string {
return this._scheme;
}

get port(): string {
return this._port === 0 ? "" : this._port.toString();
}

get endpoint(): string {
return this._endpoint;
}
}
Loading

0 comments on commit 2a7fa82

Please sign in to comment.