Documentation ¶
Index ¶
Constants ¶
View Source
const ( // BasePath is the base path for serving the filters API, minus the 'api' prefix BasePath = "/v1/filters" // BasePathWithID is the base path with the ID key in it, for operations on an existing filter. BasePathWithID = BasePath + "/:" + apiutil.IDKey )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements APIs for client-side aka "v1" filtering.
func New ¶
func New(processor *processing.Processor) *Module
func (*Module) FilterDELETEHandler ¶
FilterDELETEHandler swagger:operation DELETE /api/v1/filters/{id} filterV1Delete
Delete a single filter with the given ID.
--- tags: - filters produces: - application/json parameters: - name: id type: string description: ID of the filter in: path required: true security: - OAuth2 Bearer: - write:filters responses: '200': description: filter deleted '400': description: bad request '401': description: unauthorized '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) FilterGETHandler ¶
FilterGETHandler swagger:operation GET /api/v1/filters/{id} filterV1Get
Get a single filter with the given ID.
--- tags: - filters produces: - application/json parameters: - name: id type: string description: ID of the filter in: path required: true security: - OAuth2 Bearer: - read:filters responses: '200': name: filter description: Requested filter. schema: "$ref": "#/definitions/filterV1" '400': description: bad request '401': description: unauthorized '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) FilterPOSTHandler ¶
FilterPOSTHandler swagger:operation POST /api/v1/filters filterV1Post
Create a single filter.
--- tags: - filters consumes: - application/json - application/xml - application/x-www-form-urlencoded produces: - application/json parameters: - name: phrase in: formData required: true description: |- The text to be filtered. Sample: fnord minLength: 1 maxLength: 40 type: string - name: context[] in: formData required: true description: |- The contexts in which the filter should be applied. Sample: home, public enum: - home - notifications - public - thread - account type: array items: type: string collectionFormat: multi minItems: 1 uniqueItems: true - name: expires_in in: formData description: |- Number of seconds from now that the filter should expire. If omitted, filter never expires. Sample: 86400 type: number - name: irreversible in: formData description: |- Should matching entities be removed from the user's timelines/views, instead of hidden? Not supported yet. Sample: false type: boolean default: false - name: whole_word in: formData description: |- Should the filter consider word boundaries? Sample: true type: boolean default: false security: - OAuth2 Bearer: - write:filters responses: '200': name: filter description: New filter. schema: "$ref": "#/definitions/filterV1" '400': description: bad request '401': description: unauthorized '403': description: forbidden to moved accounts '404': description: not found '406': description: not acceptable '409': description: conflict (duplicate keyword) '422': description: unprocessable content '500': description: internal server error
func (*Module) FilterPUTHandler ¶
FilterPUTHandler swagger:operation PUT /api/v1/filters/{id} filterV1Put
Update a single filter with the given ID.
--- tags: - filters consumes: - application/json - application/xml - application/x-www-form-urlencoded produces: - application/json parameters: - name: id in: path type: string required: true description: ID of the filter. - name: phrase in: formData required: true description: |- The text to be filtered. Sample: fnord minLength: 1 maxLength: 40 type: string - name: context[] in: formData required: true description: |- The contexts in which the filter should be applied. Sample: home, public enum: - home - notifications - public - thread - account type: array items: type: string collectionFormat: multi minItems: 1 uniqueItems: true - name: expires_in in: formData description: |- Number of seconds from now that the filter should expire. If omitted, filter never expires. Sample: 86400 type: number - name: irreversible in: formData description: |- Should matching entities be removed from the user's timelines/views, instead of hidden? Not supported yet. Sample: false type: boolean default: false - name: whole_word in: formData description: |- Should the filter consider word boundaries? Sample: true type: boolean default: false security: - OAuth2 Bearer: - write:filters responses: '200': name: filter description: Updated filter. schema: "$ref": "#/definitions/filterV1" '400': description: bad request '401': description: unauthorized '403': description: forbidden to moved accounts '404': description: not found '406': description: not acceptable '409': description: conflict (duplicate keyword) '422': description: unprocessable content '500': description: internal server error
func (*Module) FiltersGETHandler ¶
FiltersGETHandler swagger:operation GET /api/v1/filters filtersV1Get
Get all filters for the authenticated account.
--- tags: - filters produces: - application/json security: - OAuth2 Bearer: - read:filters responses: '200': name: filters description: Requested filters. schema: type: array items: "$ref": "#/definitions/filterV1" '400': description: bad request '401': description: unauthorized '404': description: not found '406': description: not acceptable '500': description: internal server error
Click to show internal directories.
Click to hide internal directories.