text:
="mdSmdStop" value="0mil"/>
<param name="msWidth" value="14mil"/>
<param name="msDrill" value="24mil"/>
<param name="msMicroVia" value="9.99mm"/>
<param name="msBlindViaRatio" value="0.5"/>
<param name="rvPadTop" value="0.25"/>
<param name="rvPadInner" value="0.25"/>
<param name="rvPadBottom" value="0.25"/>
<param name="rvViaOuter" value="0.25"/>
<param name="rvViaInner" value="0.25"/>
<param name="rvMicroViaOuter" value="0.25"/>
<param name="rvMicroViaInner" value="0.25"/>
<param name="rlMinPadTop" value="10mil"/>
<param name="rlMaxPadTop" value="20mil"/>
<param name="rlMinPadInner" value="10mil"/>
<param name="rlMaxPadInner" value="20mil"/>
<param name="rlMinPadBottom" value="10mil"/>
<param name="rlMaxPadBottom" value="20mil"/>
<param name="rlMinViaOuter" value="8mil"/>
<param name="rlMaxViaOuter" value="20mil"/>
<param name="rlMinViaInner" value="8mil"/>
<param name="rlMaxViaInner" value="20mil"/>
<param name="rlMinMicroViaOuter" value="4mil"/>
<param name="rlMaxMicroViaOuter" value="20mil"/>
<param name="rlMinMicroViaInner" value="4mil"/>
<param name="rlMaxMicroViaInner" value="20mil"/>
<param name="psTop" value="-1"/>
<param name="psBottom" value="-1"/>
<param name="psFirst" value="-1"/>
<param name="psElongationLong" value="100"/>
<param name="psElongationOffset" value="100"/>
<param name="mvStopFrame" value="1"/>
<param name="mvCreamFrame" value="0"/>
<param name="mlMinStopFrame" value="4mil"/>
<param name="mlMaxStopFrame" value="4mil"/>
<param name="mlMinCreamFrame" value="0mil"/>
<param name="mlMaxCreamFrame" value="0mil"/>
<param name="mlViaStopLimit" value="0mil"/>
<param name="srRoundness" value="0"/>
<param name="srMinRoundness" value="0mil"/>
<param name="srMaxRoundness" value="0mil"/>
<param name="slThermalIsolate" value="10mil"/>
<param name="slThermalsForVias" value="0"/>
<param name="dpMaxLengthDifference" value="10mm"/>
<param name="dpGapFactor" value="2.5"/>
<param name="checkAngle" value="0"/>
<param name="checkFont" value="1"/>
<param name="checkRestrict" value="1"/>
<param name="checkStop" value="0"/>
<param name="checkValues" value="0"/>
<param name="checkNames" value="1"/>
<param name="checkWireStubs" value="1"/>
<param name="checkPolygonWidth" value="0"/>
<param name="useDiameter" value="13"/>
<param name="maxErrors" value="50"/>
</designrules>
<autorouter>
<pass name="Default">
<param name="RoutingGrid" value="0.5mm"/>
<param name="AutoGrid" value="1"/>
<param name="Efforts" value="2"/>
<param name="TopRouterVariant" value="1"/>
<param name="tpViaShape" value="round"/>
<param name="PrefDir.1" value="-"/>
<param name="PrefDir.2" value="0"/>
<param name="PrefDir.3" value="0"/>
<param name="PrefDir.4" value="0"/>
<param name="PrefDir.5" value="0"/>
<param name="PrefDir.6" value="0"/>
<param name="PrefDir.7" value="0"/>
<param name="PrefDir.8" value="0"/>
<param name="PrefDir.9" value="0"/>
<param name="PrefDir.10" value="0"/>
<param name="PrefDir.11" value="0"/>
<param name="PrefDir.12" value="0"/>
<param name="PrefDir.13" value="0"/>
<param name="PrefDir.14" value="0"/>
<param name="PrefDir.15" value="0"/>
<param name="PrefDir.16" value="0"/>
<param name="cfVia" value="8"/>
<param name="cfNonPref" value="5"/>
<param name="cfChangeDir" value="2"/>
<param name="cfOrthStep" value="2"/>
<param name="cfDiagStep" value="3"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="1"/>
<param name="cfMalusStep" value="1"/>
<param name="cfPadImpact" value="4"/>
<param name="cfSmdImpact" value="4"/>
<param name="cfBusImpact" value="0"/>
<param name="cfHugging" value="3"/>
<param name="cfAvoid" value="4"/>
<param name="cfPolygon" value="10"/>
<param name="cfBase.1" value="0"/>
<param name="cfBase.2" value="1"/>
<param name="cfBase.3" value="1"/>
<param name="cfBase.4" value="1"/>
<param name="cfBase.5" value="1"/>
<param name="cfBase.6" value="1"/>
<param name="cfBase.7" value="1"/>
<param name="cfBase.8" value="1"/>
<param name="cfBase.9" value="1"/>
<param name="cfBase.10" value="1"/>
<param name="cfBase.11" value="1"/>
<param name="cfBase.12" value="1"/>
<param name="cfBase.13" value="1"/>
<param name="cfBase.14" value="1"/>
<param name="cfBase.15" value="1"/>
<param name="cfBase.16" value="0"/>
<param name="mnVias" value="20"/>
<param name="mnSegments" value="9999"/>
<param name="mnExtdSteps" value="9999"/>
<param name="mnRipupLevel" value="10"/>
<param name="mnRipupSteps" value="100"/>
<param name="mnRipupTotal" value="100"/>
</pass>
<pass name="Follow-me" refer="Default" active="yes">
</pass>
<pass name="Busses" refer="Default" active="yes">
<param name="cfNonPref" value="4"/>
<param name="cfBusImpact" value="4"/>
<param name="cfHugging" value="0"/>
<param name="mnVias" value="0"/>
</pass>
<pass name="Route" refer="Default" active="yes">
</pass>
<pass name="Optimize1" refer="Default" active="yes">
<param name="cfVia" value="99"/>
<param name="cfExtdStep" value="10"/>
<param name="cfHugging" value="1"/>
<param name="mnExtdSteps" value="1"/>
<param name="mnRipupLevel" value="0"/>
</pass>
<pass name="Optimize2" refer="Optimize1" active="yes">
<param name="cfNonPref" value="0"/>
<param name="cfChangeDir" value="6"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="2"/>
<param name="cfMalusStep" value="2"/>
<param name="cfPadImpact" value="2"/>
<param name="cfSmdImpact" value="2"/>
<param name="cfHugging" value="0"/>
</pass>
<pass name="Optimize3" refer="Optimize2" active="yes">
<param name="cfChangeDir" value="8"/>
<param name="cfPadImpact" value="0"/>
<param name="cfSmdImpact" value="0"/>
</pass>
<pass name="Optimize4" refer="Optimize3" active="yes">
<param name="cfChangeDir" value="25"/>
</pass>
</autorouter>
<elements>
<element name="C1" library="AVX_By_element14_Batch_1" package="CAPC3216X178N" value="18pF" x="29.572815625" y="34.337440625" smashed="yes">
<attribute name="MPN" value="0612ZC225MAT2A" x="29.572815625" y="34.337440625" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="25.077015625" y="36.013840625" size="2.0828" layer="25" ratio="10" rot="SR0"/>
<attribute name="OC_FARNELL" value="-" x="29.572815625" y="34.337440625" size="1.778" layer="27" display="off"/>
<attribute name="OC_NEWARK" value="12N3209" x="29.572815625" y="34.337440625" size="1.778" layer="27" display="off"/>
<attribute name="SUPPLIER" value="AVX" x="29.572815625" y="34.337440625" size="1.778" layer="27" display="off"/>
<attribute name="TOLERANCE" value="±20%" x="29.572815625" y="34.337440625" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="23.832415625" y="30.502040625" size="2.0828" layer="27" ratio="10" rot="SR0"/>
<attribute name="VOLTAGERATING" value="10V" x="29.572815625" y="34.337440625" size="1.778" layer="27" display="off"/>
</element>
<element name="C2" library="AVX_By_element14_Batch_1" package="CAPC3216X178N" value="18pF" x="29.537915625" y="30.92004375" smashed="yes">
<attribute name="MPN" value="0612ZC225MAT2A" x="29.537915625" y="30.92004375" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="25.042115625" y="32.59644375" size="2.0828" layer="25" ratio="10" rot="SR0"/>
<attribute name="OC_FARNELL" value="-" x="29.537915625" y="30.92004375" size="1.778" layer="27" display="off"/>
<attribute name="OC_NEWARK" value="12N3209" x="29.537915625" y="30.92004375" size="1.778" layer="27" display="off"/>
<attribute name="SUPPLIER" value="AVX" x="29.537915625" y="30.92004375" size="1.778" layer="27" display="off"/>
<attribute name="TOLERANCE" value="±20%" x="29.537915625" y="30.92004375" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="23.797515625" y="27.08464375" size="2.0828" layer="27" ratio="10" rot="SR0"/>
<attribute name="VOLTAGERATING" value="10V" x="29.537915625" y="30.92004375" size="1.778" layer="27" display="off"/>
</element>
<element name="328-1" library="atmega8" package="TQFP32-08" value="ATMEGA328P-AU" x="43.7967125" y="37.73814375" smashed="yes">
<attribute name="NAME" x="41.0281125" y="42.81814375" size="0.8128" layer="25"/>
<attribute name="VALUE" x="40.7741125" y="36.46814375" size="0.8128" layer="27"/>
</element>
<element name="CRYSTAL1" library="NX5032GA(1)" package="2-SMD-5X3" value="16Mhz" x="34.798578125" y="32.929134375" smashed="yes" rot="R90">
<attribute name="AVAILABILITY" value="Unavailable" x="34.798578125" y="32.929134375" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="DESCRIPTION" value=" 25MHz ±50ppm Crystal 8pF 70 Ohms 2-SMD, No Lead " x="34.798578125" y="32.929134375" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MF" value="NDK America," x="34.798578125" y="32.929134375" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MP" value="NX5032GA" x="34.798578125" y="32.929134375" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="NAME" x="32.265178125" y="25.300334375" size="1.27" layer="25" rot="R90"/>
<attribute name="PACKAGE" value="SMD-2 NDK America," x="34.798578125" y="32.929134375" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="PRICE" value="None" x="34.798578125" y="32.929134375" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="VALUE" x="39.109978125" y="25.300334375" size="1.27" layer="27" rot="R90"/>
</element>
<element name="R1" library="01_SparkFun" package="1206" value="10k" x="18.6578875" y="39.28495" smashed="yes" rot="R90">
<attribute name="NAME" x="17.5148875" y="38.01495" size="0.4064" layer="25" rot="R90"/>
<attribute name="VALUE" x="20.1818875" y="37.88795" size="0.4064" layer="27" rot="R90"/>
</element>
<element name="LED_GREEN" library="01_FAB_Hello" package="1206" value="" x="18.7098625" y="32.368884375" smashed="yes" rot="R270">
<attribute name="NAME" x="19.8528625" y="33.765884375" size="1.27" layer="25" rot="R270"/>
<attribute name="VALUE" x="16.2968625" y="33.765884375" size="1.27" layer="27" rot="R270"/>
</element>
<element name="R2" library="01_SparkFun" package="1206" value="499" x="23.6048" y="30.9051375" smashed="yes">
<attribute name="NAME" x="22.3348" y="32.0481375" size="0.4064" layer="25"/>
<attribute name="VALUE" x="22.2078" y="29.3811375" size="0.4064" layer="27"/>
</element>
<element name="C3" library="01_SparkFun" package="1206" value="10uF" x="55.265625" y="36.849490625" smashed="yes" rot="R90">
<attribute name="NAME" x="54.12261875" y="35.57949375" size="0.4064" layer="25" rot="R90"/>
<attribute name="VALUE" x="56.78961875" y="35.45249375" size="0.4064" layer="27" rot="R90"/>
</element>
<element name="C4" library="01_SparkFun" package="1206" value="1uF" x="52.238625" y="36.79949375" smashed="yes" rot="R90">
<attribute name="NAME" x="51.495621875" y="35.529496875" size="0.4064" layer="25" rot="R90"/>
<attribute name="VALUE" x="53.76261875" y="35.402496875" size="0.4064" layer="27" rot="R90"/>
</element>
<element name="C5" library="01_SparkFun" package="1206" value="100nF" x="57.914646875" y="36.851415625" smashed="yes" rot="R90">
<attribute name="NAME" x="56.77164375" y="35.5814125" size="0.4064" layer="25" rot="R90"/>
<attribute name="VALUE" x="59.438646875" y="35.45441875" size="0.4064" layer="27" rot="R90"/>
</element>
<element name="C6" library="01_SparkFun" package="1206" value="100nF" x="14.09415" y="40.70689375" smashed="yes" rot="R180">
<attribute name="NAME" x="15.36415" y="39.56389375" size="0.4064" layer="25" rot="R180"/>
<attribute name="VALUE" x="15.49115" y="42.23089375" size="0.4064" layer="27" rot="R180"/>
</element>
<element name="POWER" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="5.961740625" y="32.196978125" smashed="yes" rot="R90">
<attribute name="MF" value="" x="5.961740625" y="32.196978125" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MPN" value="237-102" x="5.961740625" y="32.196978125" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="NAME" x="10.965540625" y="28.350778125" size="1.27" layer="25" ratio="10" rot="R90"/>
<attribute name="OC_FARNELL" value="unknown" x="5.961740625" y="32.196978125" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="5.961740625" y="32.196978125" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="POPULARITY" value="32" x="5.961740625" y="32.196978125" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="VALUE" x="13.581740625" y="27.156978125" size="1.27" layer="27" ratio="10" rot="R90"/>
</element>
<element name="SERIAL" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="53.6403625" y="51.1422875" smashed="yes" rot="R180">
<attribute name="MF" value="" x="53.6403625" y="51.1422875" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="MPN" value="237-102" x="53.6403625" y="51.1422875" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="NAME" x="57.4865625" y="56.1460875" size="1.27" layer="25" ratio="10" rot="R180"/>
<attribute name="OC_FARNELL" value="unknown" x="53.6403625" y="51.1422875" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="53.6403625" y="51.1422875" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="POPULARITY" value="32" x="53.6403625" y="51.1422875" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="VALUE" x="58.6803625" y="58.7622875" size="1.27" layer="27" ratio="10" rot="R180"/>
</element>
<element name="RESETS" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="9.00304375" y="51.376484375" smashed="yes" rot="R180">
<attribute name="MF" value="" x="9.00304375" y="51.376484375" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="MPN" value="237-102" x="9.00304375" y="51.376484375" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="NAME" x="12.54924375" y="56.180284375" size="1.27" layer="25" ratio="10" rot="R180"/>
<attribute name="OC_FARNELL" value="unknown" x="9.00304375" y="51.376484375" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="9.00304375" y="51.376484375" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="POPULARITY" value="32" x="9.00304375" y="51.376484375" size="1.778" layer="27" rot="R180" display="off"/>
<attribute name="VALUE" x="14.04304375" y="58.996484375" size="1.27" layer="27" ratio="10" rot="R180"/>
</element>
<element name="U1" library="SparkFun-RF" package="ESP8266_ESP-01" value="ESP8266_ESP-01" x="26.9" y="66.4" smashed="yes" rot="MR270">
<attribute name="NAME" x="40.3136" y="66.9048" size="0.6096" layer="26" ratio="20" rot="MR270" align="top-center"/>
<attribute name="SF_ID" value="WRL-13678" x="26.9" y="66.4" size="1.778" layer="28" rot="MR270" display="off"/>
<attribute name="VALUE" x="21.3" y="66.1" size="0.6096" layer="28" ratio="20" rot="MR270" align="center"/>
</element>
<element name="R7" library="fab" package="R1206FAB" value="2k" x="30.919403125" y="62.609253125" smashed="yes" rot="R180">
<attribute name="NAME" x="32.697403125" y="61.339253125" size="1.016" layer="25" ratio="15" rot="R180"/>
<attribute name="VALUE" x="32.697403125" y="64.895253125" size="1.016" layer="27" ratio="15" rot="R180"/>
</element>
<element name="R6" library="fab" package="R1206FAB" value="1k" x="45.72965625" y="52.436509375" smashed="yes" rot="R180">
<attribute name="NAME" x="47.50765625" y="51.166509375" size="1.016" layer="25" ratio="15" rot="R180"/>
<attribute name="VALUE" x="47.50765625" y="54.722509375" size="1.016" layer="27" ratio="15" rot="R180"/>
</element>
<element name="C10" library="fab" package="C1206FAB" value="100uf" x="31.730709375" y="68.680403125" smashed="yes" rot="R270">
<attribute name="NAME" x="33.000709375" y="70.458403125" size="1.016" layer="25" ratio="15" rot="R270"/>
<attribute name="VALUE" x="29.444709375" y="70.458403125" size="1.016" layer="27" ratio="15" rot="R270"/>
</element>
<element name="IC1" library="burr-brown" library_urn="urn:adsk.eagle:library:111" package="SOT223" package3d_urn="urn:adsk.eagle:package:4940/1" value="REG1117" x="24.57958125" y="68.319615625" smashed="yes" rot="R90">
<attribute name="MF" value="" x="24.57958125" y="68.319615625" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MPN" value="REG1117" x="24.57958125" y="68.319615625" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="NAME" x="20.26158125" y="65.779615625" size="1.27" layer="25" ratio="10" rot="R90"/>
<attribute name="OC_FARNELL" value="1097566" x="24.57958125" y="68.319615625" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="OC_NEWARK" value="14P6981" x="24.57958125" y="68.319615625" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="POPULARITY" value="49" x="24.57958125" y="68.319615625" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="VALUE" x="30.42158125" y="65.525615625" size="1.27" layer="27" ratio="10" rot="R90"/>
</element>
<element name="X1" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="68.200125" y="15.4279125" smashed="yes">
<attribute name="MF" value="" x="68.200125" y="15.4279125" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="237-102" x="68.200125" y="15.4279125" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="64.353925" y="10.4241125" size="1.27" layer="25" ratio="10"/>
<attribute name="OC_FARNELL" value="unknown" x="68.200125" y="15.4279125" size="1.778" layer="27" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="68.200125" y="15.4279125" size="1.778" layer="27" display="off"/>
<attribute name="POPULARITY" value="32" x="68.200125" y="15.4279125" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="63.160125" y="7.8079125" size="1.27" layer="27" ratio="10"/>
</element>
<element name="X2" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="57.88645" y="15.427890625" smashed="yes">
<attribute name="MF" value="" x="47.75205" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="237-102" x="47.75205" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="54.04025" y="10.424090625" size="1.27" layer="25" ratio="10"/>
<attribute name="OC_FARNELL" value="unknown" x="47.75205" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="47.75205" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="POPULARITY" value="32" x="47.75205" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="52.84645" y="7.807890625" size="1.27" layer="27" ratio="10"/>
</element>
<element name="X3" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="47.574490625" y="15.427890625" smashed="yes">
<attribute name="MF" value="" x="37.440090625" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="237-102" x="37.440090625" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="43.728290625" y="10.424090625" size="1.27" layer="25" ratio="10"/>
<attribute name="OC_FARNELL" value="unknown" x="37.440090625" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="37.440090625" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="POPULARITY" value="32" x="37.440090625" y="27.366090625" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="42.534490625" y="7.807890625" size="1.27" layer="27" ratio="10"/>
</element>
<element name="X4" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="37.262528125" y="15.377125" smashed="yes">
<attribute name="MF" value="" x="27.128128125" y="27.315325" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="237-102" x="27.128128125" y="27.315325" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="33.416328125" y="10.373325" size="1.27" layer="25" ratio="10"/>
<attribute name="OC_FARNELL" value="unknown" x="27.128128125" y="27.315325" size="1.778" layer="27" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="27.128128125" y="27.315325" size="1.778" layer="27" display="off"/>
<attribute name="POPULARITY" value="32" x="27.128128125" y="27.315325" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="32.222528125" y="7.757125" size="1.27" layer="27" ratio="10"/>
</element>
<element name="X5" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="26.876128125" y="15.377125" smashed="yes">
<attribute name="MF" value="" x="6.607328125" y="36.662725" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="237-102" x="6.607328125" y="36.662725" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="23.029928125" y="10.373325" size="1.27" layer="25" ratio="10"/>
<attribute name="OC_FARNELL" value="unknown" x="6.607328125" y="36.662725" size="1.778" layer="27" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="6.607328125" y="36.662725" size="1.778" layer="27" display="off"/>
<attribute name="POPULARITY" value="32" x="6.607328125" y="36.662725" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="21.836128125" y="7.757125" size="1.27" layer="27" ratio="10"/>
</element>
<element name="X6" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="16.5636625" y="15.377125" smashed="yes">
<attribute name="MF" value="" x="-13.8395375" y="46.010125" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="237-102" x="-13.8395375" y="46.010125" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="12.7174625" y="10.373325" size="1.27" layer="25" ratio="10"/>
<attribute name="OC_FARNELL" value="unknown" x="-13.8395375" y="46.010125" size="1.778" layer="27" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="-13.8395375" y="46.010125" size="1.778" layer="27" display="off"/>
<attribute name="POPULARITY" value="32" x="-13.8395375" y="46.010125" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="11.5236625" y="7.757125" size="1.27" layer="27" ratio="10"/>
</element>
<element name="X7" library="con-wago-500" library_urn="urn:adsk.eagle:library:195" package="W237-102" package3d_urn="urn:adsk.eagle:package:10688/1" value="" x="6.26715" y="15.376234375" smashed="yes">
<attribute name="MF" value="" x="6.26715" y="15.376234375" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="237-102" x="6.26715" y="15.376234375" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="2.42095" y="10.372434375" size="1.27" layer="25" ratio="10"/>
<attribute name="OC_FARNELL" value="unknown" x="6.26715" y="15.376234375" size="1.778" layer="27" display="off"/>
<attribute name="OC_NEWARK" value="70K9898" x="6.26715" y="15.376234375" size="1.778" layer="27" display="off"/>
<attribute name="POPULARITY" value="32" x="6.26715" y="15.376234375" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="1.22715" y="7.756234375" size="1.27" layer="27" ratio="10"/>
</element>
<element name="LCD1" library="lcd_2x16_led_backlight" package="HY-1602F" value="LCD_2X16_SIL" x="4.9028" y="-6.4788" smashed="yes">
<attribute name="NAME" x="-0.5572" y="-3.6788" size="1.27" layer="25"/>
</element>
<element name="R3" library="pot" library_urn="urn:adsk.eagle:library:331" package="3223J" package3d_urn="urn:adsk.eagle:package:22724/1" value="" x="5.8601625" y="5.346865625" smashed="yes">
<attribute name="NAME" x="4.2726625" y="7.569365625" size="1.27" layer="25"/>
<attribute name="POPULARITY" value="0" x="5.8601625" y="5.346865625" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="3.9551625" y="1.854365625" size="1.27" layer="27"/>
</element>
</elements>
<signals>
<signal name="5V">
<contactref element="328-1" pad="4"/>
<contactref element="328-1" pad="6"/>
<contactref element="328-1" pad="18"/>
<contactref element="328-1" pad="20"/>
<contactref element="R1" pad="1"/>
<contactref element="C4" pad="1"/>
<contactref element="C5" pad="1"/>
<contactref element="C3" pad="1"/>
<contactref element="LED_GREEN" pad="1"/>
<contactref element="POWER" pad="2"/>
<contactref element="IC1" pad="3"/>
<contactref element="X2" pad="1"/>
<contactref element="X4" pad="1"/>
<contactref element="X6" pad="1"/>
<contactref element="LCD1" pad="2"/>
<contactref element="LCD1" pad="15"/>
<contactref element="R3" pad="1"/>
<contactref element="X5" pad="1"/>
<wire x1="18.6578875" y1="37.88495" x2="27.72918125" y2="70.631015625" width="0" layer="19" extent="1-1"/>
<wire x1="18.7098625" y1="33.790884375" x2="18.6578875" y2="37.88495" width="0" layer="19" extent="1-1"/>
<wire x1="7.231740625" y1="34.696978125" x2="18.7098625" y2="33.790884375" width="0" layer="19" extent="1-1"/>
<wire x1="14.0636625" y1="14.107125" x2="18.7098625" y2="33.790884375" width="0" layer="19" extent="1-1"/>
<wire x1="24.376128125" y1="14.107125" x2="14.0636625" y2="14.107125" width="0" layer="19" extent="1-1"/>
<wire x1="34.762528125" y1="14.107125" x2="24.376128125" y2="14.107125" width="0" layer="19" extent="1-1"/>
<wire x1="3.8601625" y1="6.746865625" x2="14.0636625" y2="14.107125" width="0" layer="19" extent="1-1"/>
<wire x1="9.9828" y1="-6.4788" x2="3.8601625" y2="6.746865625" width="0" layer="19" extent="1-1"/>
<wire x1="55.38645" y1="14.157890625" x2="34.762528125" y2="14.107125" width="0" layer="19" extent="1-1"/>
<wire x1="39.6311125" y1="38.13814375" x2="18.6578875" y2="37.88495" width="0" layer="19" extent="1-1"/>
<wire x1="39.6311125" y1="36.53814375" x2="39.6311125" y2="38.13814375" width="0" layer="19" extent="1-1"/>
<wire x1="47.9623125" y1="35.73814375" x2="39.6311125" y2="36.53814375" width="0" layer="19" extent="1-1"/>
<wire x1="47.9623125" y1="37.33814375" x2="47.9623125" y2="35.73814375" width="0" layer="19" extent="1-1"/>
<wire x1="52.238625" y1="35.39949375" x2="47.9623125" y2="35.73814375" width="0" layer="19" extent="1-1"/>
<wire x1="55.265625" y1="35.449490625" x2="52.238625" y2="35.39949375" width="0" layer="19" extent="1-1"/>
<wire x1="57.914646875" y1="35.451415625" x2="55.265625" y2="35.449490625" width="0" layer="19" extent="1-1"/>
<wire x1="43.0028" y1="-6.4788" x2="34.762528125" y2="14.107125" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="N$2">
<contactref element="328-1" pad="7"/>
<contactref element="CRYSTAL1" pad="2"/>
<contactref element="C1" pad="2"/>
<wire x1="34.798578125" y1="34.929134375" x2="39.6311125" y2="35.73814375" width="0" layer="19" extent="1-1"/>
<wire x1="31.071415625" y1="34.337440625" x2="34.798578125" y2="34.929134375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="N$9">
<contactref element="328-1" pad="8"/>
<contactref element="CRYSTAL1" pad="1"/>
<contactref element="C2" pad="2"/>
<wire x1="34.798578125" y1="30.929134375" x2="39.3771125" y2="34.93814375" width="0" layer="19" extent="1-1"/>
<wire x1="31.036515625" y1="30.92004375" x2="34.798578125" y2="30.929134375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="GND">
<contactref element="328-1" pad="3"/>
<contactref element="328-1" pad="5"/>
<contactref element="C1" pad="1"/>
<contactref element="C2" pad="1"/>
<contactref element="328-1" pad="21"/>
<contactref element="R2" pad="2"/>
<contactref element="C4" pad="2"/>
<contactref element="C5" pad="2"/>
<contactref element="C3" pad="2"/>
<contactref element="POWER" pad="1"/>
<contactref element="R7" pad="2"/>
<contactref element="U1" pad="8"/>
<contactref element="C10" pad="2"/>
<contactref element="IC1" pad="1"/>
<contactref element="X3" pad="1"/>
<contactref element="X1" pad="1"/>
<contactref element="LCD1" pad="5"/>
<contactref element="LCD1" pad="16"/>
<contactref element="LCD1" pad="1"/>
<contactref element="R3" pad="3"/>
<wire x1="31.730709375" y1="67.029403125" x2="35.49" y2="70.21" width="0" layer="19" extent="1-1"/>
<wire x1="27.72918125" y1="66.059015625" x2="31.730709375" y2="67.029403125" width="0" layer="19" extent="1-1"/>
<wire x1="29.268403125" y1="62.609253125" x2="27.72918125" y2="66.059015625" width="0" layer="19" extent="1-1"/>
<wire x1="39.6311125" y1="38.93814375" x2="29.268403125" y2="62.609253125" width="0" layer="19" extent="1-1"/>
<wire x1="39.6311125" y1="37.33814375" x2="39.6311125" y2="38.93814375" width="0" layer="19" extent="1-1"/>
<wire x1="47.9623125" y1="38.13814375" x2="39.6311125" y2="38.93814375" width="0" layer="19" extent="1-1"/>
<wire x1="52.238625" y1="38.19949375" x2="47.9623125" y2="38.13814375" width="0" layer="19" extent="1-1"/>
<wire x1="55.265625" y1="38.249490625" x2="52.238625" y2="38.19949375" width="0" layer="19" extent="1-1"/>
<wire x1="57.914646875" y1="38.251415625" x2="55.265625" y2="38.249490625" width="0" layer="19" extent="1-1"/>
<wire x1="28.074215625" y1="34.337440625" x2="39.6311125" y2="37.33814375" width="0" layer="19" extent="1-1"/>
<wire x1="28.039315625" y1="30.92004375" x2="28.074215625" y2="34.337440625" width="0" layer="19" extent="1-1"/>
<wire x1="25.0048" y1="30.9051375" x2="28.039315625" y2="30.92004375" width="0" layer="19" extent="1-1"/>
<wire x1="7.231740625" y1="29.696978125" x2="25.0048" y2="30.9051375" width="0" layer="19" extent="1-1"/>
<wire x1="45.074490625" y1="14.157890625" x2="39.6311125" y2="37.33814375" width="0" layer="19" extent="1-1"/>
<wire x1="65.700125" y1="14.1579125" x2="45.074490625" y2="14.157890625" width="0" layer="19" extent="1-1"/>
<wire x1="45.5428" y1="-6.4788" x2="45.074490625" y2="14.157890625" width="0" layer="19" extent="1-1"/>
<wire x1="3.8601625" y1="3.946865625" x2="7.231740625" y2="29.696978125" width="0" layer="19" extent="1-1"/>
<wire x1="7.4428" y1="-6.4788" x2="3.8601625" y2="3.946865625" width="0" layer="19" extent="1-1"/>
<wire x1="17.6028" y1="-6.4788" x2="7.4428" y2="-6.4788" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="N$26">
<contactref element="LED_GREEN" pad="2"/>
<contactref element="R2" pad="1"/>
<wire x1="18.7098625" y1="30.946884375" x2="22.2048" y2="30.9051375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="N$29">
</signal>
<signal name="RST-FTDI">
<contactref element="C6" pad="2"/>
<contactref element="RESETS" pad="2"/>
<wire x1="12.69415" y1="40.70689375" x2="6.50304375" y2="52.646484375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="RST">
<contactref element="R1" pad="2"/>
<contactref element="328-1" pad="29"/>
<contactref element="C6" pad="1"/>
<contactref element="RESETS" pad="1"/>
<wire x1="18.6578875" y1="40.68495" x2="43.3967125" y2="41.90374375" width="0" layer="19" extent="1-1"/>
<wire x1="15.49415" y1="40.70689375" x2="18.6578875" y2="40.68495" width="0" layer="19" extent="1-1"/>
<wire x1="11.50304375" y1="52.646484375" x2="15.49415" y2="40.70689375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="PIN_VOLTAGE_READ_A0">
<contactref element="328-1" pad="23"/>
<contactref element="X1" pad="2"/>
<wire x1="70.700125" y1="14.1579125" x2="47.9623125" y2="39.73814375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="PIN_TORCH_TRIGGER_A1">
<contactref element="328-1" pad="24"/>
<contactref element="X2" pad="2"/>
<wire x1="60.38645" y1="14.157890625" x2="48.2163125" y2="40.53814375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="RX">
<contactref element="328-1" pad="30"/>
<contactref element="SERIAL" pad="1"/>
<contactref element="U1" pad="1"/>
<wire x1="56.1403625" y1="52.4122875" x2="38.03" y2="70.21" width="0" layer="19" extent="1-1"/>
<wire x1="42.5967125" y1="41.90374375" x2="56.1403625" y2="52.4122875" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="PIN_GAS_ON_3">
<contactref element="328-1" pad="1"/>
</signal>
<signal name="PIN_THERMAL_SAFETY_13">
<contactref element="328-1" pad="17"/>
</signal>
<signal name="PIN_CURRENT_ON_12">
<contactref element="328-1" pad="16"/>
</signal>
<signal name="PIN_CURRENT_READ_A2">
<contactref element="328-1" pad="25"/>
<contactref element="X3" pad="2"/>
<wire x1="50.074490625" y1="14.157890625" x2="46.5967125" y2="42.15774375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="TX">
<contactref element="328-1" pad="31"/>
<contactref element="SERIAL" pad="2"/>
<contactref element="R6" pad="1"/>
<wire x1="47.38065625" y1="52.436509375" x2="51.1403625" y2="52.4122875" width="0" layer="19" extent="1-1"/>
<wire x1="41.7967125" y1="41.90374375" x2="51.1403625" y2="52.4122875" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="N$3">
<contactref element="U1" pad="7"/>
</signal>
<signal name="N$4">
<contactref element="U1" pad="6"/>
</signal>
<signal name="N$5">
<contactref element="U1" pad="5"/>
<contactref element="R7" pad="1"/>
<contactref element="R6" pad="2"/>
<wire x1="32.570403125" y1="62.609253125" x2="35.49" y2="62.59" width="0" layer="19" extent="1-1"/>
<wire x1="44.07865625" y1="52.436509375" x2="35.49" y2="62.59" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="N$6">
<contactref element="U1" pad="2"/>
<contactref element="U1" pad="4"/>
<contactref element="C10" pad="1"/>
<contactref element="IC1" pad="2"/>
<wire x1="38.03" y1="62.59" x2="38.03" y2="67.67" width="0" layer="19" extent="1-1"/>
<wire x1="31.730709375" y1="70.331403125" x2="38.03" y2="67.67" width="0" layer="19" extent="1-1"/>
<wire x1="27.72918125" y1="68.345015625" x2="31.730709375" y2="70.331403125" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="N$7">
<contactref element="U1" pad="3"/>
</signal>
<signal name="B6_THERMAL_SAFETY_13">
<contactref element="X4" pad="2"/>
</signal>
<signal name="N$13">
<contactref element="X7" pad="2"/>
</signal>
<signal name="N$14">
<contactref element="X7" pad="1"/>
</signal>
<signal name="LCD_2">
<contactref element="328-1" pad="32"/>
<contactref element="LCD1" pad="4"/>
<wire x1="15.0628" y1="-6.4788" x2="40.9967125" y2="42.15774375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="LCD_4">
<contactref element="328-1" pad="2"/>
<contactref element="LCD1" pad="6"/>
<wire x1="20.1428" y1="-6.4788" x2="39.6311125" y2="39.73814375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="LCD_5">
<contactref element="328-1" pad="9"/>
<contactref element="LCD1" pad="11"/>
<wire x1="32.8428" y1="-6.4788" x2="40.9967125" y2="33.31854375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="LCD_6">
<contactref element="328-1" pad="10"/>
<contactref element="LCD1" pad="12"/>
<wire x1="35.3828" y1="-6.4788" x2="41.7967125" y2="33.57254375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="LCD_7">
<contactref element="328-1" pad="11"/>
<contactref element="LCD1" pad="13"/>
<wire x1="37.9228" y1="-6.4788" x2="42.5967125" y2="33.57254375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="LCD_8">
<contactref element="328-1" pad="12"/>
<contactref element="LCD1" pad="14"/>
<wire x1="40.4628" y1="-6.4788" x2="43.3967125" y2="33.57254375" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="ENCODER_A3">
<contactref element="328-1" pad="26"/>
</signal>
<signal name="ENCODER_A4">
<contactref element="328-1" pad="27"/>
</signal>
<signal name="ENCODER_A5">
<contactref element="328-1" pad="28"/>
</signal>
<signal name="MOTOR_11">
<contactref element="328-1" pad="15"/>
</signal>
<signal name="MOTOR_10">
<contactref element="328-1" pad="14"/>
</signal>
<signal name="MOTOR_9">
<contactref element="328-1" pad="13"/>
</signal>
<signal name="10K_POTENTIOMETER">
<contactref element="LCD1" pad="3"/>
<contactref element="R3" pad="2"/>
<wire x1="12.5228" y1="-6.4788" x2="7.8601625" y2="5.346865625" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="N$22">
<contactref element="LCD1" pad="7"/>
</signal>
<signal name="N$23">
<contactref element="LCD1" pad="8"/>
</signal>
<signal name="N$24">
<contactref element="LCD1" pad="9"/>
</signal>
<signal name="N$25">
<contactref element="LCD1" pad="10"/>
</signal>
<signal name="RELAY_PIN_GAS_ON_3">
<contactref element="X6" pad="2"/>
</signal>
<signal name="RELAY_PIN_CURRENT_ON_12">
<contactref element="X5" pad="2"/>
</signal>
</signals>
<mfgpreviewcolors>
<mfgpreviewcolor name="soldermaskcolor" color="0xC8008000"/>
<mfgpreviewcolor name="silkscreencolor" color="0xFFFEFEFE"/>
<mfgpreviewcolor name="backgroundcolor" color="0xFF282828"/>
<mfgpreviewcolor name="coppercolor" color="0xFFFFBF00"/>
<mfgpreviewcolor name="substratecolor" color="0xFF786E46"/>
</mfgpreviewcolors>
</board>
</drawing>
<compatibility>
<note version="8.2" severity="warning">
Since Version 8.2, EAGLE supports online libraries. The ids
of those online libraries will not be understood (or retained)
with this version.
</note>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports URNs for individual library
assets (packages, symbols, and devices). The URNs of those assets
will not be understood (or retained) with this version.
</note>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports the association of 3D packages
with devices in libraries, schematics, and board files. Those 3D
packages will not be understood (or retained) with this version.
</note>
</compatibility>
</eagle>


text:
package als_test

import (
	envoyal "github.com/envoyproxy/go-control-plane/envoy/config/filter/accesslog/v2"
	"github.com/gogo/protobuf/types"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/solo-io/gloo/projects/gloo/pkg/api/v1/plugins/als"

	. "github.com/solo-io/gloo/projects/gloo/pkg/plugins/als"
	translatorutil "github.com/solo-io/gloo/projects/gloo/pkg/translator"

	envoyapi "github.com/envoyproxy/go-control-plane/envoy/api/v2"
	envoylistener "github.com/envoyproxy/go-control-plane/envoy/api/v2/listener"
	envoyalcfg "github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v2"
	envoyhttp "github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2"
	envoytcp "github.com/envoyproxy/go-control-plane/envoy/config/filter/network/tcp_proxy/v2"
	envoyutil "github.com/envoyproxy/go-control-plane/pkg/util"
	v1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
	"github.com/solo-io/gloo/projects/gloo/pkg/plugins"
)

var _ = Describe("Plugin", func() {

	var (
		strFormat, path string
		jsonFormat      *types.Struct
		fsStrFormat     *als.FileSink_StringFormat
		fsJsonFormat    *als.FileSink_JsonFormat
		alsConfig       *als.AccessLoggingService
	)

	BeforeEach(func() {
		strFormat, path = "formatting string", "path"
		jsonFormat = &types.Struct{
			Fields: map[string]*types.Value{},
		}
		fsStrFormat = &als.FileSink_StringFormat{
			StringFormat: strFormat,
		}
		fsJsonFormat = &als.FileSink_JsonFormat{
			JsonFormat: jsonFormat,
		}
	})

	Context("string", func() {

		var checkConfig = func(al *envoyal.AccessLog) {
			Expect(al.Name).To(Equal(envoyutil.FileAccessLog))
			var falCfg envoyalcfg.FileAccessLog
			err := translatorutil.ParseConfig(al, &falCfg)
			Expect(err).NotTo(HaveOccurred())
			Expect(falCfg.Path).To(Equal(path))
			str := falCfg.GetFormat()
			Expect(str).To(Equal(strFormat))
		}

		BeforeEach(func() {
			alsConfig = &als.AccessLoggingService{
				AccessLog: []*als.AccessLog{
					{
						OutputDestination: &als.AccessLog_FileSink{
							FileSink: &als.FileSink{
								Path:         path,
								OutputFormat: fsStrFormat,
							},
						},
					},
				},
			}
		})
		It("http", func() {
			hl := &v1.HttpListener{}

			in := &v1.Listener{
				ListenerType: &v1.Listener_HttpListener{
					HttpListener: hl,
				},
				Plugins: &v1.ListenerPlugins{
					AccessLoggingService: alsConfig,
				},
			}

			filters := []envoylistener.Filter{{
				Name: envoyutil.HTTPConnectionManager,
			}}

			outl := &envoyapi.Listener{
				FilterChains: []envoylistener.FilterChain{{
					Filters: filters,
				}},
			}

			p := NewPlugin()
			err := p.ProcessListener(plugins.Params{}, in, outl)
			Expect(err).NotTo(HaveOccurred())

			var cfg envoyhttp.HttpConnectionManager
			err = translatorutil.ParseConfig(&filters[0], &cfg)
			Expect(err).NotTo(HaveOccurred())

			Expect(cfg.AccessLog).To(HaveLen(1))
			al := cfg.AccessLog[0]
			checkConfig(al)
		})
		It("tcp", func() {
			tl := &v1.TcpListener{}
			in := &v1.Listener{
				ListenerType: &v1.Listener_TcpListener{
					TcpListener: tl,
				},
				Plugins: &v1.ListenerPlugins{
					AccessLoggingService: alsConfig,
				},
			}

			filters := []envoylistener.Filter{{
				Name: envoyutil.TCPProxy,
			}}

			outl := &envoyapi.Listener{
				FilterChains: []envoylistener.FilterChain{{
					Filters: filters,
				}},
			}

			p := NewPlugin()
			err := p.ProcessListener(plugins.Params{}, in, outl)
			Expect(err).NotTo(HaveOccurred())

			var cfg envoytcp.TcpProxy
			err = translatorutil.ParseConfig(&filters[0], &cfg)
			Expect(err).NotTo(HaveOccurred())

			Expect(cfg.AccessLog).To(HaveLen(1))
			al := cfg.AccessLog[0]
			checkConfig(al)
		})

	})

	Context("json", func() {
		var checkConfig = func(al *envoyal.AccessLog) {
			Expect(al.Name).To(Equal(envoyutil.FileAccessLog))
			var falCfg envoyalcfg.FileAccessLog
			err := translatorutil.ParseConfig(al, &falCfg)
			Expect(err).NotTo(HaveOccurred())
			Expect(falCfg.Path).To(Equal(path))
			jsn := falCfg.GetJsonFormat()
			Expect(jsn).To(Equal(jsonFormat))
		}

		BeforeEach(func() {
			alsConfig = &als.AccessLoggingService{
				AccessLog: []*als.AccessLog{
					{
						OutputDestination: &als.AccessLog_FileSink{
							FileSink: &als.FileSink{
								Path:         path,
								OutputFormat: fsJsonFormat,
							},
						},
					},
				},
			}
		})

		It("http", func() {
			hl := &v1.HttpListener{}
			in := &v1.Listener{
				ListenerType: &v1.Listener_HttpListener{
					HttpListener: hl,
				},
				Plugins: &v1.ListenerPlugins{
					AccessLoggingService: alsConfig,
				},
			}

			filters := []envoylistener.Filter{{
				Name: envoyutil.HTTPConnectionManager,
			}}

			outl := &envoyapi.Listener{
				FilterChains: []envoylistener.FilterChain{{
					Filters: filters,
				}},
			}

			p := NewPlugin()
			err := p.ProcessListener(plugins.Params{}, in, outl)
			Expect(err).NotTo(HaveOccurred())

			var cfg envoyhttp.HttpConnectionManager
			err = translatorutil.ParseConfig(&filters[0], &cfg)
			Expect(err).NotTo(HaveOccurred())

			Expect(cfg.AccessLog).To(HaveLen(1))
			al := cfg.AccessLog[0]
			checkConfig(al)
		})
		It("tcp", func() {
			tl := &v1.TcpListener{}
			in := &v1.Listener{
				ListenerType: &v1.Listener_TcpListener{
					TcpListener: tl,
				},
				Plugins: &v1.ListenerPlugins{
					AccessLoggingService: alsConfig,
				},
			}

			filters := []envoylistener.Filter{{
				Name: envoyutil.TCPProxy,
			}}

			outl := &envoyapi.Listener{
				FilterChains: []envoylistener.FilterChain{{
					Filters: filters,
				}},
			}

			p := NewPlugin()
			err := p.ProcessListener(plugins.Params{}, in, outl)
			Expect(err).NotTo(HaveOccurred())

			var cfg envoytcp.TcpProxy
			err = translatorutil.ParseConfig(&filters[0], &cfg)
			Expect(err).NotTo(HaveOccurred())

			Expect(cfg.AccessLog).To(HaveLen(1))
			al := cfg.AccessLog[0]
			checkConfig(al)
		})
	})
})

repository: leosunmo/gloo

license_type: permissive

repo_name: leosunmo/gloo

branch_name: refs/heads/master

extension: go