I've been using these cheap AC Male Power Sockets from Amazon and Ebay for a number of my projects. They are easy to incorporate into my electronic enclosures, and they provide both a switch and fuse for whatever load. Unfortunately, no wiring diagram or instructions are provided with these units. Several sources on the internet discuss how to wire these [1,2], although the knowledge is a bit scattered. My attempt here is to put all of this knowledge into one place as well and discuss safety and offer suggestions for mounting the unit into your enclosure.
Note: images courtesy of [3].
[1] https://www.amazon.com/review/RD487YB8O446U/ref=c...
[3] https://www.amazon.com/gp/product/B0050HH70E/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
Before starting on this project, you need to be aware of related electrical hazards and how to keep yourself safe. 120V AC can lead to fires and, although not commonly, kill.
Before wiring up the socket, you should take a minute to understand its circuit diagram. Power connects to the front, and the exposed electrodes are on the back. A fuse connects the "unfused hot" to the "fused hot" section on the back (see image). The fuse is internal to the enclosure and can be accessed from the front.
To incorporate the switch into the circuit, two jumpers need to connect the left-most electrodes to the switch. Notice that the switch has two sets of electrodes, the narrower set and the wider set. The jumpers should connect the socket electrodes to the narrow set in order for the LED in the switch to work. Polarity shouldn't matter. Wires connected to the wide set of electrodes, in addition to the ground, continue on to your load.
(Edit thanks to dave-46): Note that the wire colors specified in my diagram is specific to United State 120V wiring code. If you live in another country, your colors may likely be different.
As far as wiring, I recommend either soldering (for permanent installation) or crimp terminals (for ease of maintenance). Using the diagram on the previous section, make the correct connections. As previously discussed, make sure you use the correct wire gauge.
Edit: In the pictures above, I'm using 12 gauge wire as I want this unit to safely handle 10amps.
Please see the attached diagram and CAD files for mounting hole dimensions for the socket. Units are in inches. Most of my enclosures are laser cut, and I use this same CAD files when cutting the mounting holes. Dremel or other cutting tools will work just as well. If using one of these methods, print out the cad file to scale on a sheet of paper, trim and tape it to whatever surface, and drill and cut along the lines. M3 or 4-40 screws are the ideal size for the screw holes.
Good luck!