Skip to content

Commit e3e851c

Browse files
committed
fixup: rename Options to TransportOptions
Signed-off-by: Lance Ball <[email protected]>
1 parent 07cbb42 commit e3e851c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/transport/emitter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Protocol } from ".";
44
import { AxiosResponse } from "axios";
55
import { Agent } from "http";
66

7-
export interface Options {
7+
export interface TransportOptions {
88
/**
99
* The endpoint that will receieve the event.
1010
* @example http://cncf.example.com/receiver
@@ -21,7 +21,7 @@ export interface Options {
2121
}
2222

2323
interface EmitterFunction {
24-
(event: CloudEvent, options: Options): Promise<AxiosResponse>;
24+
(event: CloudEvent, options: TransportOptions): Promise<AxiosResponse>;
2525
}
2626

2727
/**
@@ -36,7 +36,7 @@ export class Emitter {
3636
protocol: Protocol;
3737
emitter: EmitterFunction;
3838

39-
constructor(options: Options = { protocol: Protocol.HTTPBinary }) {
39+
constructor(options: TransportOptions = { protocol: Protocol.HTTPBinary }) {
4040
this.protocol = options.protocol as Protocol;
4141
this.url = options.url;
4242
this.emitter = emitBinary;
@@ -58,7 +58,7 @@ export class Emitter {
5858
* be overridden by providing a URL here.
5959
* @returns {Promise} Promise with an eventual response from the receiver
6060
*/
61-
send(event: CloudEvent, options?: Options): Promise<AxiosResponse> {
61+
send(event: CloudEvent, options?: TransportOptions): Promise<AxiosResponse> {
6262
options = options || {};
6363
options.url = options.url || this.url;
6464
if (options.protocol != this.protocol) {

src/transport/http/binary_emitter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
22

33
import { CloudEvent, Version } from "../../event";
4-
import { Options } from "../emitter";
4+
import { TransportOptions } from "../emitter";
55
import { Headers, headersFor } from "./headers";
66
import { asData } from "../../event/validation";
77
import CONSTANTS from "../../constants";
88

9-
export async function emitBinary(event: CloudEvent, options: Options): Promise<AxiosResponse> {
9+
export async function emitBinary(event: CloudEvent, options: TransportOptions): Promise<AxiosResponse> {
1010
if (event.specversion !== Version.V1 && event.specversion !== Version.V03) {
1111
return Promise.reject(`Unknown spec version ${event.specversion}`);
1212
} else {
1313
return emit(event, options, headersFor(event));
1414
}
1515
}
1616

17-
async function emit(event: CloudEvent, options: Options, headers: Headers): Promise<AxiosResponse> {
17+
async function emit(event: CloudEvent, options: TransportOptions, headers: Headers): Promise<AxiosResponse> {
1818
const contentType: Headers = { [CONSTANTS.HEADER_CONTENT_TYPE]: CONSTANTS.DEFAULT_CE_CONTENT_TYPE };
1919
const config = {
2020
...options,

src/transport/http/structured_emitter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
22
import { CloudEvent } from "../../event";
3-
import { Options } from "../emitter";
3+
import { TransportOptions } from "../emitter";
44
import { asBase64, isBinary } from "../../event/validation";
55
import CONSTANTS from "../../constants";
66

@@ -10,7 +10,7 @@ const defaults = {
1010
},
1111
};
1212

13-
export function emitStructured(event: CloudEvent, options: Options): Promise<AxiosResponse> {
13+
export function emitStructured(event: CloudEvent, options: TransportOptions): Promise<AxiosResponse> {
1414
const config = {
1515
...defaults,
1616
...options,

0 commit comments

Comments
 (0)